I am trying to add a build dependency on a url to a jar along the lines of the suggestions in given by Daz DeBoer in the forums here: http://gsfn.us/t/2m4hp
I think I have it working in one case, but another jar on githup doesn’t work. What I think is happening is the the Ivy resolver first tries to get the .ivy file, which doesn’t exist. But, because the github server returns a “403 Forbidden” instead of a 404, it gives up, even though if it just went ahead and tried to get the jar using the same pattern, it would succeed. To see this, replace “.xml” with “.jar” and the download works.
Is this an ivy or gradle bug? Should I be doing something different so that the lack of the .ivy file does not cause a build failure?
This is with Gradle 1.0-milestone-7. thanks Philip
Here is the build.gradle, using the izpack plugin as a test case:
buildscript {
repositories {
ivy {
artifactPattern 'http://cloud.github.com/downloads/[organisation]/[module]/[module]-[revision].[ext]'
}
}
dependencies {
classpath 'bmuschko:gradle-izpack-plugin:0.1'
}
}
And the output:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve group:bmuschko, module:gradle-izpack-plugin, version:0.1.
Required by:
:testDownload:unspecified
Cause: Could not GET 'http://cloud.github.com/downloads/bmuschko/gradle-izpack-plugin/gradle-izpack-plugin-0.1.xml'. Received status code 403 from server: Forbidden
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Here is another example for a different jar, also where the corresponding .ivy file does not exist:
buildscript {
repositories {
ivy {
artifactPattern 'http://gradle-macappbundle.googlecode.com/files/[module]-[revision].[ext]'
}
}
dependencies {
classpath 'edu.sc.seis:gradle-macappbundle:1.0.1'
}
}
and the output:
Download http://gradle-macappbundle.googlecode.com/files/gradle-macappbundle-1.0.1.jar
:help
Welcome to Gradle 1.0-milestone-7.
To run a build, run gradle <task> ...
To see a list of available tasks, run gradle tasks
To see a list of command-line options, run gradle --help
BUILD SUCCESSFUL