I need to work completely off-line. The reason is I have hundreds of parallel gradle builds that collide with eachother (many cache lock timeouts) if they use the same cache dir. So, to work around this, I use a separate cache dir for each build, which would require every build re-download all dependencies unless they are local.
I’ve been able to get this mostly working using this task to aggregate my dependencies into a local folder and including them in the distribution:
task archiveDependencies(type: Sync) {
from configurations
into "$buildDir/dependencyArchive"
}
I won’t get into the packaging, but the above dependencyArchive folder ends on on the target machine in the flatDir below.
repositories {
flatDir(name: 'fileRepo', dirs: "/opt/nim/parserV4/lib/dependencyArchive")
}
It’s not ideal as I have to edit the script during installation to replace the actual maven repos with the above flatDir repo.
This works for everything except cobertura. I’m using the salisman cobertura fork as described here:
The error I get is:
07:48:40.468 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
07:48:40.468 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred configuring root project 'parserV4'.
07:48:40.469 [ERROR] [org.gradle.BuildExceptionReporter] > Could not resolve all dependencies for configuration ':classpath'.
07:48:40.469 [ERROR] [org.gradle.BuildExceptionReporter]
> Could not find net.saliman:gradle-cobertura-plugin:2.1.0.
I have the gradle-cobertura-plugin-2.1.0.jar in the above flatDir.
Any idea why gradle is not finding it there?
If I remove cobertura from my build completely, the above solution works. However I’d like to leave it in there and avoid having to hack the script to bits on deployment just to satisfy some dependency requirements.