I noticed following problem when using maven and ivy repositories. My motivation for doing that is: * our main dependency repository is an internal ivy repository (manually maintained, carefully defined dependency configurations) * a few libraries are patched by us, and deployed into our internal Nexus (as that already exists for other, maven-oriented projects)
Now the problem is: * direct project dependency is a patched version in the Nexus maven repo * transitive dependencies of that are original versions in the ivy repository * when gradle resolves these transitive dependencies, it references all configurations of the ivy modules (including the one I use for sources)
I’m aware that maven has no support for dependency configurations like ivy does, but I would have expected the default configuration to be referenced, not all.
output
$ gradle dependencies
compile - Classpath for compiling the main sources.
+--- com.inxmail:jakarta-slide-webdavlib:2.2pre1-inxfix [default]
# <-- in Nexus maven repo
|
+--- org.apache.commons:commons-httpclient:3.1 [default]
# <-- in ivy repo, has only default configuration, so "works by accident"
|
|
\--- org.apache.commons:commons-codec:1.4 [default] (*)
|
\--- org.jdom:jdom:1.1.2 [default,source,javadoc]
# <-- source and javadoc configurations are unwanted here
build.gradle dependency declaration
dependencies {
// ...
compile "com.inxmail:jakarta-slide-webdavlib:2.2pre1-inxfix"
}
jakarta-slide-webdavlib pom.xml
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.inxmail</groupId>
<artifactId>jakarta-slide-webdavlib</artifactId>
<version>2.2pre1-inxfix-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.1.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
jdom ivy.xml
<ivy-module xmlns:m="http://ant.apache.org/ivy/maven">
<configurations>
<conf name="default"/>
<conf name="source"/>
<conf name="javadoc"/>
</configurations>
<publications>
<artifact conf="default"/>
<artifact name="jdom-source" type="source" ext="jar" m:classifier="sources" conf="source"/>
<artifact name="jdom-javadoc" type="javadoc" ext="jar" m:classifier="javadoc" conf="javadoc"/>
</publications>
</ivy-module>