ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georges Labrèche <glabre...@stream57.com>
Subject RE: Exception When Directly Executing The Ivy JAR.
Date Thu, 16 Apr 2009 22:46:59 GMT
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 <glabreche@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 <tom.widmer@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/

Mime
View raw message