I believe that the plugin does not behave correctly regarding dependencies resolution. I'm expecting it to use latest version of a library with the same name, but it is pulling one from upstream (previous version).
To confirm that I have created a multi-project with two projects and master. I'm using third party library as an example. EntityUtils.consumeQuietly() was introduced in 4.2 version of httpcore and is not available in 4.1.x.
I'm using latest version of plugin and tried with both, 1.3 and 1.4-rc-2 versions of Gradle.
master/settings.gradle
master/build.gradleCode:includeFlat 'foo', 'bar'
foo/build.gradleCode:subprojects { apply plugin: 'java' repositories { mavenCentral() } }
bar/build.gradleCode:dependencies { compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.1.3' }
bar/src/main/java/HelloWorld.javaCode:dependencies { compile project(':foo') compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.2.1' }
But I can build the project with Gradle command line without any issues and it reports proper dependencies.Code:import org.apache.http.util.EntityUtils; public class HelloWorld { public static void main(String[] args) throws Exception { EntityUtils.consumeQuietly(null); } }
NB: Same problem with IntelliJ IDEA, so I'm suspecting there might be something on Gradle tooling side, although their command line process works flawlessly.Code:andrey-mbp:bar andrey$ gradle dependencies :bar:dependencies ------------------------------------------------------------ Project :bar ------------------------------------------------------------ archives - Configuration for archive artifacts. No dependencies compile - Classpath for compiling the main sources. +--- master:foo:unspecified | \--- org.apache.httpcomponents:httpcore:4.1.3 -> 4.2.1 \--- org.apache.httpcomponents:httpcore:4.2.1 default - Configuration for default artifacts. +--- master:foo:unspecified | \--- org.apache.httpcomponents:httpcore:4.1.3 -> 4.2.1 \--- org.apache.httpcomponents:httpcore:4.2.1 runtime - Classpath for running the compiled main classes. +--- master:foo:unspecified | \--- org.apache.httpcomponents:httpcore:4.1.3 -> 4.2.1 \--- org.apache.httpcomponents:httpcore:4.2.1 testCompile - Classpath for compiling the test sources. +--- master:foo:unspecified | \--- org.apache.httpcomponents:httpcore:4.1.3 -> 4.2.1 \--- org.apache.httpcomponents:httpcore:4.2.1 testRuntime - Classpath for running the compiled test classes. +--- master:foo:unspecified | \--- org.apache.httpcomponents:httpcore:4.1.3 -> 4.2.1 \--- org.apache.httpcomponents:httpcore:4.2.1 (*) - dependencies omitted (listed previously) BUILD SUCCESSFUL Total time: 1.115 secs


Reply With Quote