I just installed Gradle 1.4 and ran it against my multiproject definitions. Gradle 1.4 complains “Could not resolve all dependencies for configuration…” on 3rd party libraries, whereas Gradle 1.3 works very well (of course I did a rerun with Gradle 1.3).
I defined all my 3rd party dependencies with symbolic names in a separate file “libraries.gradle”, and in my root project I include it like this:
subprojects { subProject ->
apply from: '../libraries.gradle'
apply plugin: 'java'
(...)
The “libraries.gradle” has definitions like these:
ext.log4jVersion
= '1.2.17'
ext.libraries = [
commons_collections
: 'commons-collections:commons-collections:3.2.1',
commons_io
: 'commons-io:commons-io:2.2',
commons_lang2
: 'org.apache.commons:commons-lang:2.6',
log4j
: "log4j:log4j:${log4jVersion}",
(....)
And dependencies of a project are declared like this (this is from the root project within the subprojects clause :
dependencies {
compile (libraries.commons_lang)
compile (libraries.log4j)
(..)
}
Gradle 1.4 obviously has a problem with my structure. On evaluation phase of the projects, it soon reports errors:
Evaluating project ':bghw_fav_jadice_server' using build file 'Q:\sources\trunk_clf\bghw_fav_jadice_server\build.gradle'
Evaluating project ':bghw_fav_server' using build file 'Q:\sources\trunk_clf\bghw_fav_server\build.gradle'.
Evaluating project ':bghw_fav_server_core' using build file 'Q:\sources\trunk_clf\bghw_fav_server_core\build.gradle'.
Evaluating project ':bghw_fav_servermethods' using build file 'Q:\sources\trunk_clf\bghw_fav_servermethods\build.gradle'
FAILURE: Build failed with an exception.
* Where:
Build file 'Q:\sources\trunk_clf\bghw_fav_servermethods\build.gradle' line: 28
* What went wrong:
A problem occurred evaluating project ':bghw_fav_servermethods'.
> Could not resolve all dependencies for configuration ':bghw_fav_servermethods:compile'.
> Could not find org.apache.commons:commons-lang3:3.1.
Required by:
de.uvdms:bghw_fav_servermethods:1.0
de.uvdms:bghw_fav_servermethods:1.0 > de.uvdms:com.tsystems.favbg.common:1.0
de.uvdms:bghw_fav_servermethods:1.0 > de.uvdms:de.uvdms.bof:1.0
de.uvdms:bghw_fav_servermethods:1.0 > de.uvdms:bghw_fav_server_core:1.0
de.uvdms:bghw_fav_servermethods:1.0 > de.uvdms:bghw_fav_server:1.0
de.uvdms:bghw_fav_servermethods:1.0 > de.uvdms:bghw_fav_server_core:1.0 > de.uvdms:de.uvdms.util:1.0
de.uvdms:bghw_fav_servermethods:1.0 > de.uvdms:bghw_fav_server_core:1.0 > de.uvdms:de.uvdms.common:1.0
de.uvdms:bghw_fav_servermethods:1.0 > de.uvdms:bghw_fav_server_core:1.0 > de.uvdms:de.uvdms.bof.common:1.0
> Could not find log4j:log4j:1.2.17.
Required by:
de.uvdms:bghw_fav_servermethods:1.0
(...)
This is somewhat curious, when the the first two projects evaluated ok, but on the third project Gradle reports the error. Curious, because I included the dependency on log4j in the root project definition as a dependency all projects need. So do the first two projects listed above in the info report. And another curiosity is the reported “line 28”: because line 28 is in the middle of a tar task definition where I have:
(...)
into ('lib') {
from jar.archivePath
from configurations.compile.resolve()
}
Any idea what changed in Gradle 1.4 that conflicts with my current solution?