You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Georges Labrèche <gl...@stream57.com> on 2009/04/16 00:30:57 UTC

Exception When Directly Executing The Ivy JAR.

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


RE: CLI options VS Ant tasks

Posted by Georges Labrèche <gl...@stream57.com>.
Hello,

Indeed, I am calling the jar directly.

I cannot make these calls from Ant because I am not using Ant. I am working with .NET projects hence using NAnt.
In my NAnt build.xml file, a call to Ivy is done via the exec task and directly on the jar, like so:

<target name="resolve-dependencies" description="Retrieve dependencies with ivy">
		<exec program="java" commandline="-jar ${ivy.jar} -sync -retrieve ${lib.dir}/[artifact]-[type]-[revision].[ext] -ivy ${ivy.dir}/ivy.xml -settings ${ivy.dir}/ivysettings.xml"/>
</target>

This is why I cannot work with Ant tasks and am relying on CLI options.

 - Georges



-----Original Message-----
From: Benjamin Damm [mailto:bdamm@silverspringnet.com] 
Sent: Thursday, April 16, 2009 8:10 PM
To: ivy-user@ant.apache.org
Subject: Re: CLI options VS Ant tasks

You're calling the jar directly, I presume?

I notice you were previously calling via ant.  You could call these from
your build.xml directly.. using an empty target that depends on
ivy:cleancache perhaps (as an example)?

-Ben

On Thu, 2009-04-16 at 18:57 -0400, Georges Labrèche wrote:
> Hello,
> 
> I am working with Ivy through the CLI and there are a few operations that seem to be only accessible through Ant tasks.
> For instance <ivy:report /> and <ivy:cleancache />. Are such operations not executable through the CLI?
> 
> Thanks and regards,
> 
>  - Georges


Re: CLI options VS Ant tasks

Posted by Benjamin Damm <bd...@silverspringnet.com>.
You're calling the jar directly, I presume?

I notice you were previously calling via ant.  You could call these from
your build.xml directly.. using an empty target that depends on
ivy:cleancache perhaps (as an example)?

-Ben

On Thu, 2009-04-16 at 18:57 -0400, Georges Labrèche wrote:
> Hello,
> 
> I am working with Ivy through the CLI and there are a few operations that seem to be only accessible through Ant tasks.
> For instance <ivy:report /> and <ivy:cleancache />. Are such operations not executable through the CLI?
> 
> Thanks and regards,
> 
>  - Georges


CLI options VS Ant tasks

Posted by Georges Labrèche <gl...@stream57.com>.
Hello,

I am working with Ivy through the CLI and there are a few operations that seem to be only accessible through Ant tasks.
For instance <ivy:report /> and <ivy:cleancache />. Are such operations not executable through the CLI?

Thanks and regards,

 - Georges

RE: Exception When Directly Executing The Ivy JAR.

Posted by Georges Labrèche <gl...@stream57.com>.
Hello,

I tried it again, just to be sure, and yes, I am using the exact same JAR in both cases: ivy-2.1.0-rc1.

Regards,

 - Georges

-----Original Message-----
From: Xavier Hanin [mailto:xavier.hanin@gmail.com] 
Sent: Thursday, April 16, 2009 6:33 PM
To: ivy-user@ant.apache.org
Subject: Re: Exception When Directly Executing The Ivy JAR.

2009/4/16 Georges Labrèche <gl...@stream57.com>

> Hello,
>
> Using the following worked:
>
> <exec program="java" commandline="-jar ${ivy.jar} -retrieve
> ${lib.dir}/[artifact]-[type].[ext]"/>
>
> Thank you Tom.
>
> I doubt the Ant ivy:retrieve task fails silently because the artifacts are
> successfully stored in the lib folder.

Are you sure you use the same version of Ivy from Ant and from the command
line? The error you get is a new check in Ivy 2.1.0-rc1, so it may "fail"
silently from Ant and if you use an older version. Having artifacts copied
to the lib directory doesn't mean it "works" you may actually end up with an
artifact which is not exactly the one you want (source vs jar artifact).


Xavier


>
> I just think that the default retrieve pattern for the ivy:retrieve ant
> task is [artifact]-[type].[ext] but it is not the case for the retrieve from
> CLI hence the need to explicitly specify it.
>
> I've created a JIRA issue, the JIRA key is IVY-1064.
>
> Thanks and regards,
>
>  - Georges
>
>
> -----Original Message-----
> From: Maarten Coene [mailto:maarten_coene@yahoo.com]
> Sent: Thursday, April 16, 2009 7:01 AM
> To: ivy-user@ant.apache.org
>  Subject: Re: Exception When Directly Executing The Ivy JAR.
>
>
> I think the default behaviour of ivy:retrieve in Ant should be the same as
> the retrieve from CLI, could you please create a JIRA issue for this?
>
> Maarten
>
>
>
> ----- Original Message ----
> From: Tom Widmer <to...@gmail.com>
> To: ivy-user@ant.apache.org
> Sent: Thursday, April 16, 2009 1:42:57 AM
> Subject: Re: Exception When Directly Executing The Ivy JAR.
>
> Georges Labrèche wrote:
> > 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.
>
> Or possibly fails silently...
>
> > 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?
>
> I think it's a real error, since commons-cli (in common with many maven
> generated libraries) probably has multiple artifacts with the same name
> (lib, sources and javadoc). Try something like
> <exec program="java" commandline="-jar ${ivy.jar} -retrieve
> ${lib.dir}/[artifact]-[type].[ext]"/>
>
> or, better, update your ivy.xml file so you only depend on the default conf
> of maven artifacts, and not *.
>
> Tom
>
>
>
>


-- 
Xavier Hanin - 4SH France
BordeauxJUG co leader - http://www.bordeauxjug.org/
Blogger - http://xhab.blogspot.com/
Apache Ivy Creator - http://ant.apache.org/ivy/

Re: Exception When Directly Executing The Ivy JAR.

Posted by Xavier Hanin <xa...@gmail.com>.
2009/4/16 Georges Labrèche <gl...@stream57.com>

> Hello,
>
> Using the following worked:
>
> <exec program="java" commandline="-jar ${ivy.jar} -retrieve
> ${lib.dir}/[artifact]-[type].[ext]"/>
>
> Thank you Tom.
>
> I doubt the Ant ivy:retrieve task fails silently because the artifacts are
> successfully stored in the lib folder.

Are you sure you use the same version of Ivy from Ant and from the command
line? The error you get is a new check in Ivy 2.1.0-rc1, so it may "fail"
silently from Ant and if you use an older version. Having artifacts copied
to the lib directory doesn't mean it "works" you may actually end up with an
artifact which is not exactly the one you want (source vs jar artifact).


Xavier


>
> I just think that the default retrieve pattern for the ivy:retrieve ant
> task is [artifact]-[type].[ext] but it is not the case for the retrieve from
> CLI hence the need to explicitly specify it.
>
> I've created a JIRA issue, the JIRA key is IVY-1064.
>
> Thanks and regards,
>
>  - Georges
>
>
> -----Original Message-----
> From: Maarten Coene [mailto:maarten_coene@yahoo.com]
> Sent: Thursday, April 16, 2009 7:01 AM
> To: ivy-user@ant.apache.org
>  Subject: Re: Exception When Directly Executing The Ivy JAR.
>
>
> I think the default behaviour of ivy:retrieve in Ant should be the same as
> the retrieve from CLI, could you please create a JIRA issue for this?
>
> Maarten
>
>
>
> ----- Original Message ----
> From: Tom Widmer <to...@gmail.com>
> To: ivy-user@ant.apache.org
> Sent: Thursday, April 16, 2009 1:42:57 AM
> Subject: Re: Exception When Directly Executing The Ivy JAR.
>
> Georges Labrèche wrote:
> > 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.
>
> Or possibly fails silently...
>
> > 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?
>
> I think it's a real error, since commons-cli (in common with many maven
> generated libraries) probably has multiple artifacts with the same name
> (lib, sources and javadoc). Try something like
> <exec program="java" commandline="-jar ${ivy.jar} -retrieve
> ${lib.dir}/[artifact]-[type].[ext]"/>
>
> or, better, update your ivy.xml file so you only depend on the default conf
> of maven artifacts, and not *.
>
> Tom
>
>
>
>


-- 
Xavier Hanin - 4SH France
BordeauxJUG co leader - http://www.bordeauxjug.org/
Blogger - http://xhab.blogspot.com/
Apache Ivy Creator - http://ant.apache.org/ivy/

RE: Exception When Directly Executing The Ivy JAR.

Posted by Georges Labrèche <gl...@stream57.com>.
Hello,

Using the following worked:

<exec program="java" commandline="-jar ${ivy.jar} -retrieve ${lib.dir}/[artifact]-[type].[ext]"/>

Thank you Tom.

I doubt the Ant ivy:retrieve task fails silently because the artifacts are successfully stored in the lib folder.
I just think that the default retrieve pattern for the ivy:retrieve ant task is [artifact]-[type].[ext] but it is not the case for the retrieve from CLI hence the need to explicitly specify it.

I've created a JIRA issue, the JIRA key is IVY-1064.

Thanks and regards,

 - Georges


-----Original Message-----
From: Maarten Coene [mailto:maarten_coene@yahoo.com] 
Sent: Thursday, April 16, 2009 7:01 AM
To: ivy-user@ant.apache.org
Subject: Re: Exception When Directly Executing The Ivy JAR.


I think the default behaviour of ivy:retrieve in Ant should be the same as the retrieve from CLI, could you please create a JIRA issue for this?

Maarten



----- Original Message ----
From: Tom Widmer <to...@gmail.com>
To: ivy-user@ant.apache.org
Sent: Thursday, April 16, 2009 1:42:57 AM
Subject: Re: Exception When Directly Executing The Ivy JAR.

Georges Labrèche wrote:
> 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.

Or possibly fails silently...

> 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?

I think it's a real error, since commons-cli (in common with many maven generated libraries) probably has multiple artifacts with the same name (lib, sources and javadoc). Try something like
<exec program="java" commandline="-jar ${ivy.jar} -retrieve ${lib.dir}/[artifact]-[type].[ext]"/>

or, better, update your ivy.xml file so you only depend on the default conf of maven artifacts, and not *.

Tom


      

Re: Exception When Directly Executing The Ivy JAR.

Posted by Maarten Coene <ma...@yahoo.com>.
I think the default behaviour of ivy:retrieve in Ant should be the same as the retrieve from CLI, could you please create a JIRA issue for this?

Maarten



----- Original Message ----
From: Tom Widmer <to...@gmail.com>
To: ivy-user@ant.apache.org
Sent: Thursday, April 16, 2009 1:42:57 AM
Subject: Re: Exception When Directly Executing The Ivy JAR.

Georges Labrèche wrote:
> 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.

Or possibly fails silently...

> 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?

I think it's a real error, since commons-cli (in common with many maven generated libraries) probably has multiple artifacts with the same name (lib, sources and javadoc). Try something like
<exec program="java" commandline="-jar ${ivy.jar} -retrieve ${lib.dir}/[artifact]-[type].[ext]"/>

or, better, update your ivy.xml file so you only depend on the default conf of maven artifacts, and not *.

Tom


      

Re: Exception When Directly Executing The Ivy JAR.

Posted by Tom Widmer <to...@gmail.com>.
Georges Labrèche wrote:
> 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.

Or possibly fails silently...

> 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?

I think it's a real error, since commons-cli (in common with many maven 
generated libraries) probably has multiple artifacts with the same name 
(lib, sources and javadoc). Try something like
<exec program="java" commandline="-jar ${ivy.jar} -retrieve 
${lib.dir}/[artifact]-[type].[ext]"/>

or, better, update your ivy.xml file so you only depend on the default 
conf of maven artifacts, and not *.

Tom