测试过程基于Gradle 1.2用户手册($GRADLE_HOME/docs/userguide/userguide.pdf)7.2节;
使用的实例:$GRADLE_HOME/samples/java/quickstart
cd $GRADLE_HOME/samples/java/quickstart
cat << EOF > build.gradle
repositories {
ivy {
url "e:/mydoc/localRepo"
layout 'pattern', {
artifact "[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"
ivy "[organisation]/[module]/[type]s/[artifact]-[revision].xml"
}
}
}
EOF
gradle build
:compileJava
:processResources
:classes
:jar
:assemble
:compileTestJava
:processTestResources
:testClasses
:test
:check
:build
BUILD SUCCESSFUL
Total time: 5.058 secs
参考:How to specify a relative path to the local Ivy repo in Gradle?