I just did a very ugly hack.
I have a module A which produces two jars.
moduleA.jar and moduleA.test.jar
The module.test.jar is used by other projects in the same repository and won't be published further to other repositories.
I added this to ivy.xml of moduleA
<publications>
<artifact name="moduleA" type="jar" ext="jar" conf="compile"/>
<artifact name="moduleA.test" type="jar" ext="jar" conf="test"/>
</publications>
How can I consume that in moduleB . I understand that Maven doesn't support multiple artifacts per module, and I read somewhere that this is supported by IVY. I just don't seem to get it write.
I tried this in ivy.xml of moduleB:
<dependency org="my.org" name="moduleA" rev="SNAPSHOT" conf="compile,test->default,test" />
<dependency org="my.org" name="moduleA.test" rev="SNAPSHOT" conf="compile,test->default,test" />
But this obviously didn't work, since 'name' is the name of the module not artifact. I had a work around using the type attribute: in moduleA:
<artifact name="moduleA" type="test.jar" ext="jar" conf="test"/>
and in moduleB:
<dependency org="my.org" name="moduleA" rev="SNAPSHOT" conf="compile,test->default,test" />
This worked, but looks very ugly. since I have to produce the file in ANT looking like this:
moduleA-SNAPSHOT.test.jar
any neat solution to depending on multiple artifacts of the same module?
This question id different from: How do I solve Multiple artifacts of the module X are retrieved to the same file in Apache Ivy?