ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Matthies <ml_ivy-u...@nmhq.net>
Subject Re: resolver return wrong artifact of status
Date Fri, 10 Oct 2008 19:37:58 GMT
On Thu 2008-10-09 at 16:51h, buzzterrier wrote on ivy-user:
> 
> I published two revisions of the same artifact with a release and a milestone
> statuses.
:
> ivy-milestone-1.1.xml contains:
>   <info organisation="aero.blue" module="coreTools" revision="milestone-1.1"
> status="milestone" publication="20081009160219"/>
:
> ivy-release-1.1.xml contains:
> <ivy-module version="1.0">
>     <info organisation="aero.blue" module="coreTools" revision="release-1.1"
> status="release" publication="20081009160151"/>
> 
> So the generated ivy files are correctly recording the status.
> 
> When I resolve coreTools from another project with latest.milestone, ivy
> returns the release-1.1 artifact. Below is the debug output. The resolver
> finds both revisions, but decides to use the release. Any ideas?

If you really use the strings "milestone-1.1" and "release-1.1" as the
revisions, then "release-1.1" will always be considered "later" than
"milestone-1.1", because "milestone" and "release" will be compared
lexicographically by the default latest-strategy (see [1]).

More importantly, "release-xxx" will always be considered "later"
than "milestone-yyy" regardless of the values of xxx and yyy. For
example "release-1.1" will be considered "later" than "milestone-2.0".
That's probably not what you want. One way to avoid this is to use
"1.1-milestone" and "1.1-release" instead.

But normally one doesn't encode the status into the revision string.
Instead it's more common to have something like:

    revision    status      comment
    -------------------------------------------------------------
    1.1.1       milestone   Milestone 1 of product version 1.1
    1.1.2       milestone   Milestone 2 of product version 1.1
    1.1.3       milestone   Milestone 3 of product version 1.1
    1.1.4       release     Release of product version 1.1
    1.1.5       release     Bugfix release of product version 1.1
    1.2.1       milestone   Milestone 1 of product version 1.2
    1.2.2       milestone   Milestone 2 of product version 1.2
    1.2.3       release     Release of product version 1.2
    1.3.1       milestone   Milestone 1 of product version 1.3

You get the idea.    

-- Niklas Matthies

[1] http://ant.apache.org/ivy/history/latest-milestone/settings/latest-strategies.html


Mime
View raw message