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 Ionut Scutaru <io...@gmail.com> on 2014/09/22 11:07:50 UTC

ivy buildlist producing incorrect order of dependencies

Hi,

I'm using Ivy 2.2.0 and Ant 1.9.2 and I'm currently facing a problem
related to ivy:buildlist: it generates the list of dependencies in the
project in the wrong order.

I'm attaching a configuration that shows the problem that I'm facing.

I'm running the build.xml located in the deploymentUtilities/ant.new folder
and I see this error in the console:










*[ivy:resolve]
::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]
::          UNRESOLVED DEPENDENCIES         ::[ivy:resolve]
::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]           ::
com.test.ivy#UtilPrj;1.0.0: not found[ivy:resolve]
::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve][ivy:resolve][ivy:resolve]
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS*

Could anybody help me ? I really don't understand why the order is not the
correct one.

Thank you !

Re: ivy buildlist producing incorrect order of dependencies

Posted by Ionut Scutaru <io...@gmail.com>.
Hi Zac,

Thank you for taking the time to answer my question. I was expecting that
ivy:buildlist would return the list of modules in the order of their
dependency, as it's mentined in the documentation:
http://ant.apache.org/ivy/history/latest-milestone/use/buildlist.html


*The buildlist task enable to obtain a filelist of files (usually build.xml
files) ordered according to ivy dependency information from the least
dependent to the most one, or the inverse. (since 1.2)*
The fact that the ivy:buildlist returns the modules in their alphabetical
order is contrary to what is specified, so I was wondering what am I doing
wrong in my configuration.

Any idea?


On Mon, Sep 22, 2014 at 9:37 PM, Zac Jacobson <pi...@gmail.com> wrote:

> Your ant script is building projects in alphabetical order, which happens
> to not match your ivy dependency order. So PrjDependingOnUtilPrj is built
> first, but it can't find a UtilPrj because that project hasn't been
> built/published yet.
>
> You should give your master ant file the explicit order to build/publish
> things, if that's what you want to do.
>
> On Mon, Sep 22, 2014 at 2:07 AM, Ionut Scutaru <io...@gmail.com>
> wrote:
>
> > Hi,
> >
> > I'm using Ivy 2.2.0 and Ant 1.9.2 and I'm currently facing a problem
> > related to ivy:buildlist: it generates the list of dependencies in the
> > project in the wrong order.
> >
> > I'm attaching a configuration that shows the problem that I'm facing.
> >
> > I'm running the build.xml located in the deploymentUtilities/ant.new
> > folder and I see this error in the console:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > *[ivy:resolve]
> > ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]
> > ::          UNRESOLVED DEPENDENCIES         ::[ivy:resolve]
> > ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]           ::
> > com.test.ivy#UtilPrj;1.0.0: not found[ivy:resolve]
> >
> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve][ivy:resolve][ivy:resolve]
> > :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS*
> >
> > Could anybody help me ? I really don't understand why the order is not
> the
> > correct one.
> >
> > Thank you !
> >
>

Re: ivy buildlist producing incorrect order of dependencies

Posted by Ionut Scutaru <io...@gmail.com>.
Hi Sven,
I might use the same approach as you. (Thank you for sharing your solution.)

Also I found an already filed bug. I've added my comments as well:
https://issues.apache.org/jira/browse/IVY-1001, hopefully it will be fixed
soon.

On Tue, Sep 23, 2014 at 12:33 AM, Sven Zethelius <sv...@expedia.com> wrote:

> I ran into this situation as well.  To work around it, I added an ant task
> ahead of the ivy resolve that generated a new ivy file, replacing the
> placeholders ant knew about and then using that ivy file as the actual
> dependency
>
> <copy file="${project.root}/ivy.xml" tofile="${ivy.file}">
>   <filterchain>
>     <expandproperties />
>   </filterchain>
>                 </copy>
>
>
>
>
> On 9/22/14, 2:12 PM, "Ionut Scutaru" <io...@gmail.com> wrote:
>
> >Thank you, Zac ! Indeed, I managed to track down the problem: once I set
> >the actual name of the module, everything works fine.
> >
> >For example I had to change from:
> >
> >
> >
> >*info organisation="com.test.ivy" module="${ant.project.name
> ><http://ant.project.name>}"        revision="${test.release}"
> >status="${proj.status}"/>*
> >
> >to:
> >
> >
> >*<info organisation="com.test.ivy" module="UtilPrj"
> >revision="${test.release}" status="${proj.status}"/>*
> >
> >It seems this is a bug in the buildlist ivy tag, as the
> >${ant.project.name}
> >is correctly replaced in every other situation.
> >
> >Well, for the moment I'll have to live with duplicating the module name in
> >the ivy.xml file.
> >
> >
> >
> >On Mon, Sep 22, 2014 at 10:23 PM, Zac Jacobson <pi...@gmail.com> wrote:
> >
> >> Oh I see what you mean.
> >>
> >> Well, if it's not able to establish dependencies, perhaps it doesn't
> >>take
> >> your complex ant file included into account.
> >>
> >> In your example, I put explicit values in the ivy file for UtilPrj and
> >>it
> >> seems to come back in the expected order.
> >>
> >> <info organisation="com.test.ivy" module="UtilPrj"
> >> revision="${test.release}"
> >> status="${proj.status}"/>
> >>
> >> On Mon, Sep 22, 2014 at 11:37 AM, Zac Jacobson <pi...@gmail.com>
> >>wrote:
> >>
> >> > Your ant script is building projects in alphabetical order, which
> >>happens
> >> > to not match your ivy dependency order. So PrjDependingOnUtilPrj is
> >>built
> >> > first, but it can't find a UtilPrj because that project hasn't been
> >> > built/published yet.
> >> >
> >> > You should give your master ant file the explicit order to
> >>build/publish
> >> > things, if that's what you want to do.
> >> >
> >> > On Mon, Sep 22, 2014 at 2:07 AM, Ionut Scutaru
> >><io...@gmail.com>
> >> > wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> I'm using Ivy 2.2.0 and Ant 1.9.2 and I'm currently facing a problem
> >> >> related to ivy:buildlist: it generates the list of dependencies in
> >>the
> >> >> project in the wrong order.
> >> >>
> >> >> I'm attaching a configuration that shows the problem that I'm facing.
> >> >>
> >> >> I'm running the build.xml located in the deploymentUtilities/ant.new
> >> >> folder and I see this error in the console:
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> *[ivy:resolve]
> >> >> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]
> >> >> ::          UNRESOLVED DEPENDENCIES         ::[ivy:resolve]
> >> >> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]
> >> ::
> >> >> com.test.ivy#UtilPrj;1.0.0: not found[ivy:resolve]
> >> >>
> >>
> >>::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve][ivy:resolve][
> >>ivy:resolve]
> >> >> :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS*
> >> >>
> >> >> Could anybody help me ? I really don't understand why the order is
> >>not
> >> >> the correct one.
> >> >>
> >> >> Thank you !
> >> >>
> >> >
> >> >
> >>
>
>

Re: ivy buildlist producing incorrect order of dependencies

Posted by Sven Zethelius <sv...@expedia.com>.
I ran into this situation as well.  To work around it, I added an ant task
ahead of the ivy resolve that generated a new ivy file, replacing the
placeholders ant knew about and then using that ivy file as the actual
dependency 

<copy file="${project.root}/ivy.xml" tofile="${ivy.file}">
  <filterchain>
    <expandproperties />
  </filterchain>
		</copy>




On 9/22/14, 2:12 PM, "Ionut Scutaru" <io...@gmail.com> wrote:

>Thank you, Zac ! Indeed, I managed to track down the problem: once I set
>the actual name of the module, everything works fine.
>
>For example I had to change from:
>
>
>
>*info organisation="com.test.ivy" module="${ant.project.name
><http://ant.project.name>}"        revision="${test.release}"
>status="${proj.status}"/>*
>
>to:
>
>
>*<info organisation="com.test.ivy" module="UtilPrj"
>revision="${test.release}" status="${proj.status}"/>*
>
>It seems this is a bug in the buildlist ivy tag, as the
>${ant.project.name}
>is correctly replaced in every other situation.
>
>Well, for the moment I'll have to live with duplicating the module name in
>the ivy.xml file.
>
>
>
>On Mon, Sep 22, 2014 at 10:23 PM, Zac Jacobson <pi...@gmail.com> wrote:
>
>> Oh I see what you mean.
>>
>> Well, if it's not able to establish dependencies, perhaps it doesn't
>>take
>> your complex ant file included into account.
>>
>> In your example, I put explicit values in the ivy file for UtilPrj and
>>it
>> seems to come back in the expected order.
>>
>> <info organisation="com.test.ivy" module="UtilPrj"
>> revision="${test.release}"
>> status="${proj.status}"/>
>>
>> On Mon, Sep 22, 2014 at 11:37 AM, Zac Jacobson <pi...@gmail.com>
>>wrote:
>>
>> > Your ant script is building projects in alphabetical order, which
>>happens
>> > to not match your ivy dependency order. So PrjDependingOnUtilPrj is
>>built
>> > first, but it can't find a UtilPrj because that project hasn't been
>> > built/published yet.
>> >
>> > You should give your master ant file the explicit order to
>>build/publish
>> > things, if that's what you want to do.
>> >
>> > On Mon, Sep 22, 2014 at 2:07 AM, Ionut Scutaru
>><io...@gmail.com>
>> > wrote:
>> >
>> >> Hi,
>> >>
>> >> I'm using Ivy 2.2.0 and Ant 1.9.2 and I'm currently facing a problem
>> >> related to ivy:buildlist: it generates the list of dependencies in
>>the
>> >> project in the wrong order.
>> >>
>> >> I'm attaching a configuration that shows the problem that I'm facing.
>> >>
>> >> I'm running the build.xml located in the deploymentUtilities/ant.new
>> >> folder and I see this error in the console:
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> *[ivy:resolve]
>> >> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]
>> >> ::          UNRESOLVED DEPENDENCIES         ::[ivy:resolve]
>> >> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]
>> ::
>> >> com.test.ivy#UtilPrj;1.0.0: not found[ivy:resolve]
>> >>
>> 
>>::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve][ivy:resolve][
>>ivy:resolve]
>> >> :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS*
>> >>
>> >> Could anybody help me ? I really don't understand why the order is
>>not
>> >> the correct one.
>> >>
>> >> Thank you !
>> >>
>> >
>> >
>>


Re: ivy buildlist producing incorrect order of dependencies

Posted by Ionut Scutaru <io...@gmail.com>.
Thank you, Zac ! Indeed, I managed to track down the problem: once I set
the actual name of the module, everything works fine.

For example I had to change from:



*info organisation="com.test.ivy" module="${ant.project.name
<http://ant.project.name>}"        revision="${test.release}"
status="${proj.status}"/>*

to:


*<info organisation="com.test.ivy" module="UtilPrj"
revision="${test.release}" status="${proj.status}"/>*

It seems this is a bug in the buildlist ivy tag, as the ${ant.project.name}
is correctly replaced in every other situation.

Well, for the moment I'll have to live with duplicating the module name in
the ivy.xml file.



On Mon, Sep 22, 2014 at 10:23 PM, Zac Jacobson <pi...@gmail.com> wrote:

> Oh I see what you mean.
>
> Well, if it's not able to establish dependencies, perhaps it doesn't take
> your complex ant file included into account.
>
> In your example, I put explicit values in the ivy file for UtilPrj and it
> seems to come back in the expected order.
>
> <info organisation="com.test.ivy" module="UtilPrj"
> revision="${test.release}"
> status="${proj.status}"/>
>
> On Mon, Sep 22, 2014 at 11:37 AM, Zac Jacobson <pi...@gmail.com> wrote:
>
> > Your ant script is building projects in alphabetical order, which happens
> > to not match your ivy dependency order. So PrjDependingOnUtilPrj is built
> > first, but it can't find a UtilPrj because that project hasn't been
> > built/published yet.
> >
> > You should give your master ant file the explicit order to build/publish
> > things, if that's what you want to do.
> >
> > On Mon, Sep 22, 2014 at 2:07 AM, Ionut Scutaru <io...@gmail.com>
> > wrote:
> >
> >> Hi,
> >>
> >> I'm using Ivy 2.2.0 and Ant 1.9.2 and I'm currently facing a problem
> >> related to ivy:buildlist: it generates the list of dependencies in the
> >> project in the wrong order.
> >>
> >> I'm attaching a configuration that shows the problem that I'm facing.
> >>
> >> I'm running the build.xml located in the deploymentUtilities/ant.new
> >> folder and I see this error in the console:
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> *[ivy:resolve]
> >> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]
> >> ::          UNRESOLVED DEPENDENCIES         ::[ivy:resolve]
> >> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]           ::
> >> com.test.ivy#UtilPrj;1.0.0: not found[ivy:resolve]
> >>
> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve][ivy:resolve][ivy:resolve]
> >> :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS*
> >>
> >> Could anybody help me ? I really don't understand why the order is not
> >> the correct one.
> >>
> >> Thank you !
> >>
> >
> >
>

Re: ivy buildlist producing incorrect order of dependencies

Posted by Zac Jacobson <pi...@gmail.com>.
Oh I see what you mean.

Well, if it's not able to establish dependencies, perhaps it doesn't take
your complex ant file included into account.

In your example, I put explicit values in the ivy file for UtilPrj and it
seems to come back in the expected order.

<info organisation="com.test.ivy" module="UtilPrj" revision="${test.release}"
status="${proj.status}"/>

On Mon, Sep 22, 2014 at 11:37 AM, Zac Jacobson <pi...@gmail.com> wrote:

> Your ant script is building projects in alphabetical order, which happens
> to not match your ivy dependency order. So PrjDependingOnUtilPrj is built
> first, but it can't find a UtilPrj because that project hasn't been
> built/published yet.
>
> You should give your master ant file the explicit order to build/publish
> things, if that's what you want to do.
>
> On Mon, Sep 22, 2014 at 2:07 AM, Ionut Scutaru <io...@gmail.com>
> wrote:
>
>> Hi,
>>
>> I'm using Ivy 2.2.0 and Ant 1.9.2 and I'm currently facing a problem
>> related to ivy:buildlist: it generates the list of dependencies in the
>> project in the wrong order.
>>
>> I'm attaching a configuration that shows the problem that I'm facing.
>>
>> I'm running the build.xml located in the deploymentUtilities/ant.new
>> folder and I see this error in the console:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *[ivy:resolve]
>> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]
>> ::          UNRESOLVED DEPENDENCIES         ::[ivy:resolve]
>> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]           ::
>> com.test.ivy#UtilPrj;1.0.0: not found[ivy:resolve]
>> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve][ivy:resolve][ivy:resolve]
>> :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS*
>>
>> Could anybody help me ? I really don't understand why the order is not
>> the correct one.
>>
>> Thank you !
>>
>
>

Re: ivy buildlist producing incorrect order of dependencies

Posted by Zac Jacobson <pi...@gmail.com>.
Your ant script is building projects in alphabetical order, which happens
to not match your ivy dependency order. So PrjDependingOnUtilPrj is built
first, but it can't find a UtilPrj because that project hasn't been
built/published yet.

You should give your master ant file the explicit order to build/publish
things, if that's what you want to do.

On Mon, Sep 22, 2014 at 2:07 AM, Ionut Scutaru <io...@gmail.com>
wrote:

> Hi,
>
> I'm using Ivy 2.2.0 and Ant 1.9.2 and I'm currently facing a problem
> related to ivy:buildlist: it generates the list of dependencies in the
> project in the wrong order.
>
> I'm attaching a configuration that shows the problem that I'm facing.
>
> I'm running the build.xml located in the deploymentUtilities/ant.new
> folder and I see this error in the console:
>
>
>
>
>
>
>
>
>
>
> *[ivy:resolve]
> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]
> ::          UNRESOLVED DEPENDENCIES         ::[ivy:resolve]
> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve]           ::
> com.test.ivy#UtilPrj;1.0.0: not found[ivy:resolve]
> ::::::::::::::::::::::::::::::::::::::::::::::[ivy:resolve][ivy:resolve][ivy:resolve]
> :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS*
>
> Could anybody help me ? I really don't understand why the order is not the
> correct one.
>
> Thank you !
>