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 Martin Eigenbrodt <ma...@googlemail.com> on 2009/01/08 11:09:12 UTC

Bug in ivy:deliver

I've stubmled across a bug where ivy:deliver does not replace the dynamic
revision correctly.

My Repository contains four module: junit in revision 3.8 and 4.4. A Modul A
that depends on junit 4.4 and a module B that depends on junit "3.8.+".
(Details at the bottom of this mail).

I do no resolve and deliver the following ivy:
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.4">
    <info organisation="test" module="c"/>
    <publications/>
    <dependencies>
<!-- THE ORDER OF THIS DEPENDENCIES IS IMPORTEND TO REPRODUCE THE BUG -->
        <dependency org="test" name="a" rev="latest.integration"/>
        <dependency org="test" name="b" rev="latest.integration"/>
        <dependency org="junit" name="junit" conf="default"
rev="latest.integration"/>
    </dependencies>
</ivy-module>

The delivered Ivy File does not replace the dynamic revision for junit:

<dependency org="junit" name="junit" conf="default"
rev="latest.integration"/>

The expected outcome would be:
<dependency org="junit" name="junit" conf="default" rev="4.4"
revConstraint="latest.integration"/>

Please note that moving the dependency to junit on line higher (above "b")
leads to the epected outcome.
I've searched the issue tracker but did not find an open bug matching this
problem, but since this is quite complex setup I may have missed somethingh.
Is this a known problem?
What can I do to increase the chances of this bug beeing fixed? The
behaviour of ivy depending on the order of dependencies is very anoying in
real live.
The bug was reproduced with rc2 and a private build from trunk.
Thanks for reading and still beeing with me.

Martin


Details:

junit-3.8  (For simplicity I removed artifacs and dependencies form the
original junit)
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.0">
    <info organisation="junit" module="junit" revision="3.8"
status="integration" publication="20090108103716"/>
    <publications/>
</ivy-module>

junit-4.4  (For simplicity I removed artifacs and dependencies form the
original junit)
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.0">
    <info organisation="junit" module="junit" revision="4.4"
status="integration" publication="20090108103715"/>
    <publications/>
</ivy-module>

Module "A":
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.4">
   <info organisation="test" module="a" revision="1" status="integration"
publication="20090108103716"/>
   <publications/>
   <dependencies>
      <dependency org="junit" name="junit" rev="4.4"/>
   </dependencies>
</ivy-module>

Module "B"
<ivy-module version="1.0">
    <info organisation="test" module="b" revision="1.5" status="integration"
publication="20090108103716"/>
    <publications/>
    <dependencies>
        <dependency org="junit" name="junit" rev="3.8+" conf="default"/>
    </dependencies>
</ivy-module>

My Ivysettings:
<ivyconf>
    <conf defaultResolver="local"/>
    <resolvers>
        <filesystem name="local" >
            <ivy
pattern="${basedir}/testrepo/[organisation]/[module]/ivy-[revision].xml"/>
            <artifact
pattern="${basedir}/testrepo/[organisation]/[module]/[artifact]-[revision].[ext]"/>
        </filesystem>

    </resolvers>
</ivyconf>

The ant file:
<?xml version="1.0" encoding="UTF-8"?>
<project name="bugreport" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant">
    <target name="init_ivy">
        <path id="ivy.path" location="ivy-2.1.x.jar"/>
        <taskdef resource="org/apache/ivy/ant/antlib.xml"
              uri="antlib:org.apache.ivy.ant" classpathref="ivy.path"/>
        <ivy:configure file="ivysettings.xml"/>
    </target>
    <target name="test" depends="init_ivy">
        <ivy:resolve file="ivy-c.xml"/>
        <ivy:deliver/>
    </target>
</project>

Re: Bug in ivy:deliver

Posted by Martin Eigenbrodt <ma...@googlemail.com>.
Ok. I'll try to write a unittest for this.
Ticket:
https://issues.apache.org/jira/browse/IVY-999

Martin

2009/1/8 Maarten Coene <ma...@yahoo.com>

> Hi Martin,
>
> can you create a new bug report in JIRA? Please add as much detail as
> possible (your mail is detailed enough I think, maybe you can also attach
> the ant verbose log)
>
> Attaching a patch that fixes the problem is the fastest way to get things
> fixed.
> But if that is too difficult, adding a simple reproduceable testcase can
> also increase the chance to have this issue fixed soon.
>
> Maarten
>
>
>
> ----- Original Message ----
> From: Martin Eigenbrodt <ma...@googlemail.com>
> To: ivy-user@ant.apache.org
> Sent: Thursday, January 8, 2009 11:09:12 AM
> Subject: Bug in ivy:deliver
>
> I've stubmled across a bug where ivy:deliver does not replace the dynamic
> revision correctly.
>
> My Repository contains four module: junit in revision 3.8 and 4.4. A Modul
> A
> that depends on junit 4.4 and a module B that depends on junit "3.8.+".
> (Details at the bottom of this mail).
>
> I do no resolve and deliver the following ivy:
> <?xml version="1.0" encoding="UTF-8"?>
> <ivy-module version="1.4">
>    <info organisation="test" module="c"/>
>    <publications/>
>    <dependencies>
> <!-- THE ORDER OF THIS DEPENDENCIES IS IMPORTEND TO REPRODUCE THE BUG -->
>        <dependency org="test" name="a" rev="latest.integration"/>
>        <dependency org="test" name="b" rev="latest.integration"/>
>        <dependency org="junit" name="junit" conf="default"
> rev="latest.integration"/>
>    </dependencies>
> </ivy-module>
>
> The delivered Ivy File does not replace the dynamic revision for junit:
>
> <dependency org="junit" name="junit" conf="default"
> rev="latest.integration"/>
>
> The expected outcome would be:
> <dependency org="junit" name="junit" conf="default" rev="4.4"
> revConstraint="latest.integration"/>
>
> Please note that moving the dependency to junit on line higher (above "b")
> leads to the epected outcome.
> I've searched the issue tracker but did not find an open bug matching this
> problem, but since this is quite complex setup I may have missed
> somethingh.
> Is this a known problem?
> What can I do to increase the chances of this bug beeing fixed? The
> behaviour of ivy depending on the order of dependencies is very anoying in
> real live.
> The bug was reproduced with rc2 and a private build from trunk.
> Thanks for reading and still beeing with me.
>
> Martin
>
>
> Details:
>
> junit-3.8  (For simplicity I removed artifacs and dependencies form the
> original junit)
> <?xml version="1.0" encoding="UTF-8"?>
> <ivy-module version="1.0">
>    <info organisation="junit" module="junit" revision="3.8"
> status="integration" publication="20090108103716"/>
>    <publications/>
> </ivy-module>
>
> junit-4.4  (For simplicity I removed artifacs and dependencies form the
> original junit)
> <?xml version="1.0" encoding="UTF-8"?>
> <ivy-module version="1.0">
>    <info organisation="junit" module="junit" revision="4.4"
> status="integration" publication="20090108103715"/>
>    <publications/>
> </ivy-module>
>
> Module "A":
> <?xml version="1.0" encoding="UTF-8"?>
> <ivy-module version="1.4">
>   <info organisation="test" module="a" revision="1" status="integration"
> publication="20090108103716"/>
>   <publications/>
>   <dependencies>
>      <dependency org="junit" name="junit" rev="4.4"/>
>   </dependencies>
> </ivy-module>
>
> Module "B"
> <ivy-module version="1.0">
>    <info organisation="test" module="b" revision="1.5" status="integration"
> publication="20090108103716"/>
>    <publications/>
>    <dependencies>
>        <dependency org="junit" name="junit" rev="3.8+" conf="default"/>
>    </dependencies>
> </ivy-module>
>
> My Ivysettings:
> <ivyconf>
>    <conf defaultResolver="local"/>
>    <resolvers>
>        <filesystem name="local" >
>            <ivy
> pattern="${basedir}/testrepo/[organisation]/[module]/ivy-[revision].xml"/>
>            <artifact
>
> pattern="${basedir}/testrepo/[organisation]/[module]/[artifact]-[revision].[ext]"/>
>        </filesystem>
>
>    </resolvers>
> </ivyconf>
>
> The ant file:
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="bugreport" basedir="."
> xmlns:ivy="antlib:org.apache.ivy.ant">
>    <target name="init_ivy">
>        <path id="ivy.path" location="ivy-2.1.x.jar"/>
>        <taskdef resource="org/apache/ivy/ant/antlib.xml"
>              uri="antlib:org.apache.ivy.ant" classpathref="ivy.path"/>
>        <ivy:configure file="ivysettings.xml"/>
>    </target>
>    <target name="test" depends="init_ivy">
>        <ivy:resolve file="ivy-c.xml"/>
>        <ivy:deliver/>
>    </target>
> </project>
>
>
>
>
>

Re: Bug in ivy:deliver

Posted by Maarten Coene <ma...@yahoo.com>.
Hi Martin,

can you create a new bug report in JIRA? Please add as much detail as possible (your mail is detailed enough I think, maybe you can also attach the ant verbose log)

Attaching a patch that fixes the problem is the fastest way to get things fixed.
But if that is too difficult, adding a simple reproduceable testcase can also increase the chance to have this issue fixed soon.

Maarten



----- Original Message ----
From: Martin Eigenbrodt <ma...@googlemail.com>
To: ivy-user@ant.apache.org
Sent: Thursday, January 8, 2009 11:09:12 AM
Subject: Bug in ivy:deliver

I've stubmled across a bug where ivy:deliver does not replace the dynamic
revision correctly.

My Repository contains four module: junit in revision 3.8 and 4.4. A Modul A
that depends on junit 4.4 and a module B that depends on junit "3.8.+".
(Details at the bottom of this mail).

I do no resolve and deliver the following ivy:
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.4">
    <info organisation="test" module="c"/>
    <publications/>
    <dependencies>
<!-- THE ORDER OF THIS DEPENDENCIES IS IMPORTEND TO REPRODUCE THE BUG -->
        <dependency org="test" name="a" rev="latest.integration"/>
        <dependency org="test" name="b" rev="latest.integration"/>
        <dependency org="junit" name="junit" conf="default"
rev="latest.integration"/>
    </dependencies>
</ivy-module>

The delivered Ivy File does not replace the dynamic revision for junit:

<dependency org="junit" name="junit" conf="default"
rev="latest.integration"/>

The expected outcome would be:
<dependency org="junit" name="junit" conf="default" rev="4.4"
revConstraint="latest.integration"/>

Please note that moving the dependency to junit on line higher (above "b")
leads to the epected outcome.
I've searched the issue tracker but did not find an open bug matching this
problem, but since this is quite complex setup I may have missed somethingh.
Is this a known problem?
What can I do to increase the chances of this bug beeing fixed? The
behaviour of ivy depending on the order of dependencies is very anoying in
real live.
The bug was reproduced with rc2 and a private build from trunk.
Thanks for reading and still beeing with me.

Martin


Details:

junit-3.8  (For simplicity I removed artifacs and dependencies form the
original junit)
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.0">
    <info organisation="junit" module="junit" revision="3.8"
status="integration" publication="20090108103716"/>
    <publications/>
</ivy-module>

junit-4.4  (For simplicity I removed artifacs and dependencies form the
original junit)
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.0">
    <info organisation="junit" module="junit" revision="4.4"
status="integration" publication="20090108103715"/>
    <publications/>
</ivy-module>

Module "A":
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.4">
   <info organisation="test" module="a" revision="1" status="integration"
publication="20090108103716"/>
   <publications/>
   <dependencies>
      <dependency org="junit" name="junit" rev="4.4"/>
   </dependencies>
</ivy-module>

Module "B"
<ivy-module version="1.0">
    <info organisation="test" module="b" revision="1.5" status="integration"
publication="20090108103716"/>
    <publications/>
    <dependencies>
        <dependency org="junit" name="junit" rev="3.8+" conf="default"/>
    </dependencies>
</ivy-module>

My Ivysettings:
<ivyconf>
    <conf defaultResolver="local"/>
    <resolvers>
        <filesystem name="local" >
            <ivy
pattern="${basedir}/testrepo/[organisation]/[module]/ivy-[revision].xml"/>
            <artifact
pattern="${basedir}/testrepo/[organisation]/[module]/[artifact]-[revision].[ext]"/>
        </filesystem>

    </resolvers>
</ivyconf>

The ant file:
<?xml version="1.0" encoding="UTF-8"?>
<project name="bugreport" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant">
    <target name="init_ivy">
        <path id="ivy.path" location="ivy-2.1.x.jar"/>
        <taskdef resource="org/apache/ivy/ant/antlib.xml"
              uri="antlib:org.apache.ivy.ant" classpathref="ivy.path"/>
        <ivy:configure file="ivysettings.xml"/>
    </target>
    <target name="test" depends="init_ivy">
        <ivy:resolve file="ivy-c.xml"/>
        <ivy:deliver/>
    </target>
</project>