Consuming multiple jars from one Ivy dependency

(Martin Linha) #1


I need to consume few jars from Ivy repository with following layout

                    layout 'pattern', {
                        artifact '[organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]'
                        ivy '[organisation]/[module]/[revision]/[type]s/ivy-nexus.xml'
                        m2compatible = true

In [organisation]/[module]/[revision]/[type]s/ ivy-nexus.xml I have publications similar to

  <artifact name="A" type="jar" ext="jar" conf="main"/>
  <artifact name="A" type="source" ext="jar" e:classifier="src" conf="sources"/>
  <artifact name="B" type="jar" ext="jar" conf="main"/>
  <artifact name="B" type="source" ext="jar" e:classifier="src" conf="sources"/>

Then I have jars in following locations


in build.gradle

dependencies {
  compile '[organisation]:[module]:[revision]'

where values in brackets are of course actual values.

When I check the resolved dependencies, Gradle uses only A.jar. How can tell Gradle to use B.jar as well? Or is the problem that the jars in Ivy repository does not have classifiers to specify which one to use?

Many thanks!

(Martin Linha) #2

Oh, found the answer here