Reputation: 11
This is an example of my ivy.xml:
<dependency org="org1" name="module1" rev="1.0.0">
<artifact name="lib1-1.0.0" type="jar" />
</dependency>
<dependency org="org1" name="module1" rev="1.0.0">
<artifact name="lib2-1.0.0" type="jar" />
</dependency>
with ivy 1.0 I can download both artifacts
When I upgrade my version to ivy-2.0.0 only one of the artifact is downloaded.
Is there something in ivy settings I must specified ? I know that if I write the file like this:
<dependency org="org1" name="module1" rev="1.0.0">
<artifact name="lib1-1.0.0" type="jar" />
<artifact name="lib2-1.0.0" type="jar" />
</dependency>
it works !
But why not the first example? Is there a workaround?
Upvotes: 1
Views: 165
Reputation: 18704
The first one seems illegal. From ivys point of view you declare the same dependency twice. When dependency resolution is done one of those is dropped (ommited), because it is assumed that they are equal and only one should be taken. For me it seems bad practise to do so.
The second one is much better, because it is clear in its definition and doesn't look awkward.
Personally, I think it would be preferable to have a deployed ivy.xml in the repository, that defines exactly which artifacts are published by this module (see the publication tag and are available for a certain conf. This way you could just specify:
I suppose it would be possible to use the conflict tag to set the conflict manager to all. But I don't know if it will work.
<dependencies>
<dependency org="org1" name="module1" rev="1.0.0">
<artifact name="lib1-1.0.0" type="jar" />
</dependency>
<dependency org="org1" name="module1" rev="1.0.0">
<artifact name="lib2-1.0.0" type="jar" />
</dependency>
<conflict org="org1" module="module1" manager="all"/>
</dependencies>
Upvotes: 1