You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Hervé BOUTEMY <he...@free.fr> on 2008/05/01 22:07:02 UTC

Artifact Version Comparison

Kenney started a proposal http://docs.codehaus.org/display/MAVEN/Versioning 
with a implementation of a comparator.

I took his implementation, updated it to support comparison between more 
version schemes and integrated it to DefaultArtifactVersion class. The code 
is here http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/, with 
unit test showing version schemes in action:
http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java

I think the new ordering will give better results than the current one and 
would like to merge it to artifact trunk and 2.0.x branch. Before doing so, I 
submit the code for review: any comments?

regards,

Hervé

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Artifact Version Comparison

Posted by Jason van Zyl <ja...@maven.org>.
On 1-May-08, at 1:07 PM, Hervé BOUTEMY wrote:

> Kenney started a proposal http://docs.codehaus.org/display/MAVEN/Versioning
> with a implementation of a comparator.
>
> I took his implementation, updated it to support comparison between  
> more
> version schemes and integrated it to DefaultArtifactVersion class.  
> The code
> is here http://svn.apache.org/viewvc/maven/artifact/branches/ 
> MNG-3010/, with
> unit test showing version schemes in action:
> http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java
>
> I think the new ordering will give better results than the current  
> one and
> would like to merge it to artifact trunk and 2.0.x branch. Before  
> doing so, I
> submit the code for review: any comments?
>

All the integration tests pass? I'm just totally leery of changes to  
the artifact mechanism in the 2.0.x branch.

Every time we do this we have adversely impacted users even though we  
mean to improve it. If you have any doubt about it preserving the  
existing behavior 100% then you can't do it on the branch. Maybe we  
increase the coverage pull in some sample builds from branches of  
existing projects to build up a test bed, but we have historically not  
faired well in changing Maven Artifact.

> regards,
>
> Hervé
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
jason at sonatype dot com
----------------------------------------------------------

Our achievements speak for themselves. What we have to keep track
of are our failures, discouragements and doubts. We tend to forget
the past difficulties, the many false starts, and the painful
groping. We see our past achievements as the end result of a
clean forward thrust, and our present difficulties as
signs of decline and decay.

-- Eric Hoffer, Reflections on the Human Condition 




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Artifact Version Comparison

Posted by Hervé BOUTEMY <he...@free.fr>.
Le lundi 19 mai 2008, Brett Porter a écrit :
> So the change was just to allow numerical ordering for non-standard
> versions like alpha-1 vs alpha-11 and 5.0.9.0 vs 5.0.10.0 ?
Yes, these cases are the most common ones fixed.
I didn't work on the "pluggable version handling" part of the proposal: it's 
complicated IMHO, we'll see if it is really useful now that default version 
comparison is better that previously.

>
> That looks ok to me at first glance, but I'll take a closer look.
Thank you

Hervé

> - Brett
>
> On 16/05/2008, at 5:02 AM, Hervé BOUTEMY wrote:
> > FYI, I just merged version comparison improvement to artifact trunk.
> > 2.1.x ITs are ok, both on my machine and on Sonatype's CI server
> >
> > I hope everything is ok for everybody
> >
> > Don't hesitate to ring me if anything goes wrong
> >
> > regards,
> >
> > Hervé
> >
> > Le jeudi 01 mai 2008, Hervé BOUTEMY a écrit :
> >> Kenney started a proposal
> >> http://docs.codehaus.org/display/MAVEN/Versioning with a implementation
> >> of a comparator.
> >>
> >> I took his implementation, updated it to support comparison between
> >> more
> >> version schemes and integrated it to DefaultArtifactVersion class.
> >> The code
> >> is here http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/
> >> ,
> >> with unit test showing version schemes in action:
> >> http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/src/test/j
> >>ava /org/apache/maven/artifact/versioning/ComparableVersionTest.java
> >>
> >> I think the new ordering will give better results than the current
> >> one and
> >> would like to merge it to artifact trunk and 2.0.x branch. Before
> >> doing so,
> >> I submit the code for review: any comments?
> >>
> >> regards,
> >>
> >> Hervé
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
>
> --
> Brett Porter
> brett@apache.org
> http://blogs.exist.com/bporter/



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Artifact Version Comparison

Posted by Brett Porter <br...@apache.org>.
So the change was just to allow numerical ordering for non-standard  
versions like alpha-1 vs alpha-11 and 5.0.9.0 vs 5.0.10.0 ?

That looks ok to me at first glance, but I'll take a closer look.
- Brett

On 16/05/2008, at 5:02 AM, Hervé BOUTEMY wrote:

> FYI, I just merged version comparison improvement to artifact trunk.
> 2.1.x ITs are ok, both on my machine and on Sonatype's CI server
>
> I hope everything is ok for everybody
>
> Don't hesitate to ring me if anything goes wrong
>
> regards,
>
> Hervé
>
> Le jeudi 01 mai 2008, Hervé BOUTEMY a écrit :
>> Kenney started a proposal http://docs.codehaus.org/display/MAVEN/Versioning
>> with a implementation of a comparator.
>>
>> I took his implementation, updated it to support comparison between  
>> more
>> version schemes and integrated it to DefaultArtifactVersion class.  
>> The code
>> is here http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/ 
>> ,
>> with unit test showing version schemes in action:
>> http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/src/test/java
>> /org/apache/maven/artifact/versioning/ComparableVersionTest.java
>>
>> I think the new ordering will give better results than the current  
>> one and
>> would like to merge it to artifact trunk and 2.0.x branch. Before  
>> doing so,
>> I submit the code for review: any comments?
>>
>> regards,
>>
>> Hervé
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

--
Brett Porter
brett@apache.org
http://blogs.exist.com/bporter/


Re: Artifact Version Comparison

Posted by Hervé BOUTEMY <he...@free.fr>.
FYI, I just merged version comparison improvement to artifact trunk.
2.1.x ITs are ok, both on my machine and on Sonatype's CI server

I hope everything is ok for everybody

Don't hesitate to ring me if anything goes wrong

regards,

Hervé

Le jeudi 01 mai 2008, Hervé BOUTEMY a écrit :
> Kenney started a proposal http://docs.codehaus.org/display/MAVEN/Versioning
> with a implementation of a comparator.
>
> I took his implementation, updated it to support comparison between more
> version schemes and integrated it to DefaultArtifactVersion class. The code
> is here http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/,
> with unit test showing version schemes in action:
> http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/src/test/java
>/org/apache/maven/artifact/versioning/ComparableVersionTest.java
>
> I think the new ordering will give better results than the current one and
> would like to merge it to artifact trunk and 2.0.x branch. Before doing so,
> I submit the code for review: any comments?
>
> regards,
>
> Hervé
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Artifact Version Comparison

Posted by Jason van Zyl <ja...@maven.org>.
On 3-May-08, at 3:34 AM, Hervé BOUTEMY wrote:

> The change is only on version comparison, not version parsing to  
> dispatch info
> to ArtifactVersion API, which would have probably more impact.

This still could potentially impact users.

Just for the record I think Kenney's proposal is good, sound, and more  
correct then what we have but we still can't change the behavior in  
2.0.x. I think what you're doing is the right way to go but we  
definitely need more tests, and I'm still afraid of putting it in the  
branch because it's so quirky. Even so the behavior has to be preserved.

>
> AFAIK, version comparison is used only for version ranges, but I  
> don't know
> every aspect of Maven to be sure of this.
>
> As asked by Jason, I'll try integration tests and report before doing
> anything, either on trunk or branch.

I'm honestly more concerned about the branch. Integration tests are  
good overall but if they reveal errors we can keep track of that and  
allow the quirks to be emulated on trunk if necessary.

>
>
> Hervé
>
> Le vendredi 02 mai 2008, Brian E. Fox a écrit :
>> What's the impact to existing builds. My initial reaction is no-way  
>> in
>> 2.0.x.
>>
>> -----Original Message-----
>> From: Hervé BOUTEMY [mailto:herve.boutemy@free.fr]
>> Sent: Thursday, May 01, 2008 4:07 PM
>> To: Maven Developers List
>> Subject: Artifact Version Comparison
>>
>> Kenney started a proposal http://docs.codehaus.org/display/MAVEN/Versioning
>> with a implementation of a comparator.
>>
>> I took his implementation, updated it to support comparison between  
>> more
>> version schemes and integrated it to DefaultArtifactVersion class.  
>> The code
>> is here http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/ 
>> ,
>> with unit test showing version schemes in action:
>> http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/src/test/java
>> /org/apache/maven/artifact/versioning/ComparableVersionTest.java
>>
>> I think the new ordering will give better results than the current  
>> one and
>> would like to merge it to artifact trunk and 2.0.x branch. Before  
>> doing so,
>> I submit the code for review: any comments?
>>
>> regards,
>>
>> Hervé
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
jason at sonatype dot com
----------------------------------------------------------

To do two things at once is to do neither.

-—Publilius Syrus, Roman slave, first century B.C.




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Artifact Version Comparison

Posted by Hervé BOUTEMY <he...@free.fr>.
The change is only on version comparison, not version parsing to dispatch info 
to ArtifactVersion API, which would have probably more impact.
AFAIK, version comparison is used only for version ranges, but I don't know 
every aspect of Maven to be sure of this.

As asked by Jason, I'll try integration tests and report before doing 
anything, either on trunk or branch.

Hervé

Le vendredi 02 mai 2008, Brian E. Fox a écrit :
> What's the impact to existing builds. My initial reaction is no-way in
> 2.0.x.
>
> -----Original Message-----
> From: Hervé BOUTEMY [mailto:herve.boutemy@free.fr]
> Sent: Thursday, May 01, 2008 4:07 PM
> To: Maven Developers List
> Subject: Artifact Version Comparison
>
> Kenney started a proposal http://docs.codehaus.org/display/MAVEN/Versioning
> with a implementation of a comparator.
>
> I took his implementation, updated it to support comparison between more
> version schemes and integrated it to DefaultArtifactVersion class. The code
> is here http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/,
> with unit test showing version schemes in action:
> http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/src/test/java
>/org/apache/maven/artifact/versioning/ComparableVersionTest.java
>
> I think the new ordering will give better results than the current one and
> would like to merge it to artifact trunk and 2.0.x branch. Before doing so,
> I submit the code for review: any comments?
>
> regards,
>
> Hervé
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: Artifact Version Comparison

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
What's the impact to existing builds. My initial reaction is no-way in 2.0.x.

-----Original Message-----
From: Hervé BOUTEMY [mailto:herve.boutemy@free.fr] 
Sent: Thursday, May 01, 2008 4:07 PM
To: Maven Developers List
Subject: Artifact Version Comparison

Kenney started a proposal http://docs.codehaus.org/display/MAVEN/Versioning 
with a implementation of a comparator.

I took his implementation, updated it to support comparison between more 
version schemes and integrated it to DefaultArtifactVersion class. The code 
is here http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/, with 
unit test showing version schemes in action:
http://svn.apache.org/viewvc/maven/artifact/branches/MNG-3010/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java

I think the new ordering will give better results than the current one and 
would like to merge it to artifact trunk and 2.0.x branch. Before doing so, I 
submit the code for review: any comments?

regards,

Hervé

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Artifact Version Comparison

Posted by Hervé BOUTEMY <he...@free.fr>.
Le vendredi 02 mai 2008, Benjamin Bentmann a écrit :
> Wayne Fay wrote:
> > How is CR different from RC?
>
> I don't meant to say they are different, it's only another well-known
> qualifier, aliasing one from the existing list.
yes, I'll need to add an aliasing system: CR = RC, GA = ""

>
> > I think I'd pick one and forget about the other.
>
> Is an option, we only need to make sure to clearly explain people that
> Maven believes
>   hibernate-3.3.0.CR1 > hibernate-3.3.0.GA
>
> I have no personal interest in this, just wanted to bring it up.
>
>
> Benjamin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Artifact Version Comparison

Posted by Hervé BOUTEMY <he...@free.fr>.
Le vendredi 02 mai 2008, Gilles Scokart a écrit :
> By the way, in which case did you need to compare 2 version?
> In ivy, we use it mostly for conflict resolution.  But maven use a
> 'nearest' aproach.  So I guess there is no need to compare version
> there.
>
> Is the impact limited to version ranges?
This is the only case I'm aware of in Maven Core.

But my need was for m2eclipse, when trying to work on 
http://jira.codehaus.org/browse/MNGECLIPSE-281. I imagined that Maven's 
DefaultArtifactVersion was the best way to sort artifacts in m2eclipse 
consistently with Maven, then discovered how version sorting was broken in 
Maven... :)

Hervé

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Artifact Version Comparison

Posted by Gilles Scokart <gs...@gmail.com>.
2008/5/2 Benjamin Bentmann <be...@udo.edu>:
> Wayne Fay wrote:
>
>
> > How is CR different from RC?
> >
>
>  I don't meant to say they are different, it's only another well-known
> qualifier, aliasing one from the existing list.
>
>
>
> > I think I'd pick one and forget about the other.
> >
>
>  Is an option, we only need to make sure to clearly explain people that
> Maven believes
>   hibernate-3.3.0.CR1 > hibernate-3.3.0.GA
>
>  I have no personal interest in this, just wanted to bring it up.
>
>
>  Benjamin
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>  For additional commands, e-mail: dev-help@maven.apache.org
>
>

If some of you are interrested to know how ivy handle this, they can
have a look to [1].

Anyway, depending of the evolution of this thread, we will probably
have to add a 'latest-maven' [2].


By the way, in which case did you need to compare 2 version?
In ivy, we use it mostly for conflict resolution.  But maven use a
'nearest' aproach.  So I guess there is no need to compare version
there.

Is the impact limited to version ranges?


[1] http://ant.apache.org/ivy/history/latest-milestone/configuration/latest-strategies.html
[2] https://issues.apache.org/jira/browse/IVY-812


-- 
Gilles Scokart

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Artifact Version Comparison

Posted by Benjamin Bentmann <be...@udo.edu>.
Wayne Fay wrote:

> How is CR different from RC?

I don't meant to say they are different, it's only another well-known 
qualifier, aliasing one from the existing list.

> I think I'd pick one and forget about the other.

Is an option, we only need to make sure to clearly explain people that Maven 
believes
  hibernate-3.3.0.CR1 > hibernate-3.3.0.GA

I have no personal interest in this, just wanted to bring it up.


Benjamin 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Artifact Version Comparison

Posted by Paul Gier <pg...@redhat.com>.
Within JBoss a lot of our projects use CR and GA so that the versions can be 
sorted alphabetically.  At least that was the explanation given to me ;)

I think RC is more common in other places.  Ideally I would like to see a 
pluggable version parsing so that a given project could configure it's own 
version parsing when needed.  I think that's the only way everyone will be happy.

Wayne Fay wrote:
>> The JBoss Product Versioning [0] suggests the following additional
>> well-known qualifiers:
>> - CR
>> - FINAL
> 
> How is CR different from RC? One is Candidate Release, the other is
> Release Candidate. I think I'd pick one and forget about the other.
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Artifact Version Comparison

Posted by Wayne Fay <wa...@gmail.com>.
> The JBoss Product Versioning [0] suggests the following additional
> well-known qualifiers:
> - CR
> - FINAL

How is CR different from RC? One is Candidate Release, the other is
Release Candidate. I think I'd pick one and forget about the other.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Artifact Version Comparison

Posted by Benjamin Bentmann <be...@udo.edu>.
Hervé BOUTEMY wrote:

> Kenney started a proposal
> http://docs.codehaus.org/display/MAVEN/Versioning
> with a implementation of a comparator.

The JBoss Product Versioning [0] suggests the following additional
well-known qualifiers:
- CR
- FINAL


Benjamin


[0] http://wiki.jboss.org/wiki/JBossProductVersioning


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org