Hello,
I'm having issues when running ivy retrieve upon directly executing the JAR
instead of using the ivy:retrieve task in Ant.
The reason I am doing this is because I am using NAnt and the exec task instead
of Ant and Ivy tasks.
For instance, the build.xml Ant script of the hello-ivy example implements the
following "resolve" target:
<target name="resolve" description="--> retrieve dependencies with ivy">
<ivy:retrieve/>
</target>
This works perfectly.
Porting this to a NAnt script would result in the following "resolve" target:
<property name="ivy.jar" value="tools\ivy\ivy.jar"/>
<target name="resolve" description="--> retrieve dependencies with ivy">
<exec program="java" commandline="-jar ${ivy.jar} -retrieve ivy.xml"/>
</target>
Executing this task throws the following exception:
-----------------------------------------------------------------------
[exec] Exception in thread "main" java.lang.RuntimeException: problem durin
g retrieve of Stream57#Cortex: java.lang.RuntimeException: Multiple artifacts of
the module commons-cli#commons-cli;1.0 are retrieved to the same file! Update t
he retrieve pattern to fix this error.
[exec] :: retrieving :: Stream57#Cortex
[exec] confs: [default]
[exec] at org.apache.ivy.core.retrieve.RetrieveEngine.retrieve(RetrieveEng
ine.java:196)
[exec] at org.apache.ivy.Ivy.retrieve(Ivy.java:540)
[exec] at org.apache.ivy.Main.run(Main.java:268)
[exec] at org.apache.ivy.Main.main(Main.java:168)
[exec] Caused by: java.lang.RuntimeException: Multiple artifacts of the mod
ule commons-cli#commons-cli;1.0 are retrieved to the same file! Update the retri
eve pattern to fix this error.
[exec] at org.apache.ivy.core.retrieve.RetrieveEngine.determineArtifactsTo
Copy(RetrieveEngine.java:349)
[exec] at org.apache.ivy.core.retrieve.RetrieveEngine.retrieve(RetrieveEng
ine.java:102)
[exec] ... 3 more
-----------------------------------------------------------------------
The error message suggests to "update the retrieve pattern to fix this error."
So I have also tried the following:
<exec program="java" commandline="-jar ${ivy.jar} -retrieve
${lib.dir}/[artifact].[ext]"/>
But the same exception is thrown.
Any ideas?
Thanks and Regards,
- Georges