I’m using Gradle 1.6. Here is the project that I have:
apply plugin: 'groovy'
repositories { mavenCentral() }
dependencies {
compile 'org.apache.activemq:activemq-core:5.4.0' }
org.apache.activemq:activemq-core:5.4.0 has a compile dependency on activeio-core (http://search.maven.org/remotecontent?filepath=org/apache/activemq/activemq-core/5.4.0/activemq-core-5.4.0.pom):
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>activeio-core</artifactId>
<optional>false</optional>
</dependency>
The dependency is actually defined in here: http://search.maven.org/remotecontent?filepath=org/apache/activemq/activemq-parent/5.4.0/activemq-parent-5.4.0.pom.
Gradle doesn’t resolve the dependency:
$ ./gradlew dependencyInsight --dependency activeio-core
:dependencyInsight
No dependencies matching given input were found in configuration ':compile'
$ ./gradlew dependencies --configuration compile
:dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
compile - Compile classpath for source set 'main'.
\--- org.apache.activemq:activemq-core:5.4.0
+--- commons-logging:commons-logging-api:1.1
+--- org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1
+--- org.apache.activemq:kahadb:5.4.0
|
\--- commons-logging:commons-logging:1.1 -> 1.1.1
+--- org.apache.activemq.protobuf:activemq-protobuf:1.1
+--- org.osgi:org.osgi.core:4.1.0
+--- org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:1.0.1
+--- org.springframework:spring-context:3.0.3.RELEASE
|
+--- org.springframework:spring-aop:3.0.3.RELEASE
|
|
+--- aopalliance:aopalliance:1.0
|
|
+--- org.springframework:spring-asm:3.0.3.RELEASE
|
|
+--- org.springframework:spring-beans:3.0.3.RELEASE
|
|
|
\--- org.springframework:spring-core:3.0.3.RELEASE
|
|
|
+--- org.springframework:spring-asm:3.0.3.RELEASE
|
|
|
\--- commons-logging:commons-logging:1.1.1
|
|
\--- org.springframework:spring-core:3.0.3.RELEASE (*)
|
+--- org.springframework:spring-beans:3.0.3.RELEASE (*)
|
+--- org.springframework:spring-core:3.0.3.RELEASE (*)
|
+--- org.springframework:spring-expression:3.0.3.RELEASE
|
|
\--- org.springframework:spring-core:3.0.3.RELEASE (*)
|
\--- org.springframework:spring-asm:3.0.3.RELEASE
\--- commons-net:commons-net:2.0
$ ./gradlew dependencies | grep -i activeio-core
$ echo $?
1
(The last two lines just show that grepping all dependencies for activeio-core finds nothing.)
Can it be that Gradle gets confused with the second dependency:
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>activeio-core</artifactId>
<optional>false</optional>
<type>test-jar</type>
</dependency>
Analogous maven project:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.test</groupId>
<artifactId>maven-deps</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>5.4.0</version>
</dependency>
</dependencies>
</project>
produces this:
$ mvn dependency:tree -Dverbose
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-deps 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ maven-deps ---
[INFO] de.test:maven-deps:jar:1.0-SNAPSHOT
[INFO] \- org.apache.activemq:activemq-core:jar:5.4.0:compile
[INFO]
+- commons-logging:commons-logging-api:jar:1.1:compile
[INFO]
+- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile
[INFO]
+- org.apache.activemq:activeio-core:jar:3.1.2:compile
[INFO]
|
+- (org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1:compile - omitted for duplicate)
[INFO]
|
\- commons-logging:commons-logging:jar:1.1:compile
[INFO]
|
+- log4j:log4j:jar:1.2.12:compile
[INFO]
|
+- logkit:logkit:jar:1.0.1:compile
[INFO]
|
+- avalon-framework:avalon-framework:jar:4.1.3:compile
[INFO]
|
\- javax.servlet:servlet-api:jar:2.3:compile
[INFO]
+- org.apache.activemq:kahadb:jar:5.4.0:compile
[INFO]
|
\- (commons-logging:commons-logging:jar:1.1:compile - omitted for duplicate)
[INFO]
+- org.apache.activemq.protobuf:activemq-protobuf:jar:1.1:compile
[INFO]
+- org.osgi:org.osgi.core:jar:4.1.0:compile
[INFO]
+- org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1:compile
[INFO]
+- org.springframework:spring-context:jar:3.0.3.RELEASE:compile
[INFO]
|
+- org.springframework:spring-aop:jar:3.0.3.RELEASE:compile
[INFO]
|
|
+- aopalliance:aopalliance:jar:1.0:compile
[INFO]
|
|
+- (org.springframework:spring-asm:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO]
|
|
+- (org.springframework:spring-beans:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO]
|
|
\- (org.springframework:spring-core:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO]
|
+- org.springframework:spring-beans:jar:3.0.3.RELEASE:compile
[INFO]
|
|
\- (org.springframework:spring-core:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO]
|
+- org.springframework:spring-core:jar:3.0.3.RELEASE:compile
[INFO]
|
|
+- (org.springframework:spring-asm:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO]
|
|
\- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for conflict with 1.1)
[INFO]
|
+- org.springframework:spring-expression:jar:3.0.3.RELEASE:compile
[INFO]
|
|
\- (org.springframework:spring-core:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO]
|
\- org.springframework:spring-asm:jar:3.0.3.RELEASE:compile
[INFO]
\- commons-net:commons-net:jar:2.0:compile
As you can see, the org.apache.activemq:activeio-core:jar:3.1.2:compile dependency is there. It is not only a problem of the dependency plugin, as my originla issue comes from a webapp, and WEB-INF/lib by Gradle doesn’t contain the lib, and maven’s does.
wujek