On Mon, Feb 9, 2009 at 4:53 PM, Alex Boisvert <boisv...@intalio.com> wrote:
> Oh, right, you mean the "qualifier". > > Here's what Better Builds with > Maven<http://repo.exist.com/dist/maestro/1.7.0/BetterBuildsWithMaven.pdf > >says, > > With regard to ordering, the elements are considered in sequence to > determine which is newer - first by major version, second - if the major > versions were equal - by minor version, third by bug fix version, fourth by > qualifier (using string comparison), and finally, by build number. A > version > that contains a qualifier is older than a version without a qualifier; for > example, 1.2-beta is older than version 1.2. A version that also contains a > build number is considered newer than a version without a build number; > for example, 1.2-beta-1 is newer than 1.2-beta. Sonatype's site is down, so I used a cached copy from Feb 14 [1], but here's what it has to say: "The qualifier exists to capture milestone builds: alpha and beta releases, and the qualifier is separated from the major, minor, and incremental versions by a hyphen." I'm not sure how Better Builds misinterpreted this and decided that versions with qualifiers are older than versions without qualifiers, but by design 1.2 comes after 1.2-beta. Also: "Maven is supposed to treat the number after the qualifier as a build number. In other words, the qualifier should be "alpha", and the build number should be 2. Even though Maven has been designed to separate the build number from the qualifier, this parsing is currently broken. " So in theory beta-1 is newer than beta because it contains a build number, but in practice beta-1 is newer because it's a longer string. Except SNAPSHOT, which is a special qualifier that references the most recent qualifier that happens to look like this: "Maven would expand this version to ???1.0-20080207-230803-1??? if you were to deploy a release at 11:08 PM on February 7th, 2008UTC." So all this, the too many rules, the books that don't agree with each other, a broken implementation, just reaffirms my point that the Maven versioning scheme was an exercise in unnecessary complexity and the best way to deal with it is to ignore it. Compare to OSGI. A version number with no qualifier refers to the most recent version with any qualifier value, which is just what you would expect when you say "1.2.1", i.e. find me the most recent "1.2.1" you've got. Qualifiers are ordered lexicographically, with no special rules that depend on their value, no attempt to deconstruct them, so the algorithm is dead simple and fool-proof and you can expect all the implementations to support it. You just have to decide what to put in the qualifier. You can, say, have R<timestamp> for releases, M<name-number> for milestones, and D<timestamp> for development builds because R > M > B and conveniently alpha < beta < rc. D would be the equivalent of a snapshot, and you'll just point to a repository full of D artifacts during development, and stop pointing to it when making milestones and final releases. Assaf [1] http://209.85.173.132/search?q=cache:4B1vfCjEM3YJ:www.sonatype.com/books/maven-book/reference/pom-relationships-sect-pom-syntax.html+maven+version+qualifier+numeric&hl=en&ct=clnk&cd=5&gl=us&client=safari > > But my point still stands, Buildr should drop the SNAPSHOT qualifier (and > only SNAPSHOT) during a release. > > alex > > > > On Mon, Feb 9, 2009 at 4:36 PM, Assaf Arkin <ar...@intalio.com> wrote: > > > > > > > On Feb 9, 2009, at 4:16 PM, Alex Boisvert <boisv...@intalio.com> wrote: > > > > Ugh? If beta is not a release but a pre-release, how do you > pre-release > >> a > >> beta? > >> > > > > Then maybe it's called something else, either way the fourth part is > > constrained. > > > > > > > > > > > >> > >> > >> On Sun, Feb 8, 2009 at 10:43 PM, Assaf Arkin <ar...@intalio.com> wrote: > >> > >> On Fri, Feb 6, 2009 at 2:51 PM, Alex Boisvert <boisv...@intalio.com> > >>> wrote: > >>> > >>> The Maven conventions don't restrict the version to only numbers, so > >>>> > >>> yeah, > >>> > >>>> buildr should only strip a "-SNAPSHOT" suffix. > >>>> > >>> > >>> > >>> Actually it does: releases must end with numbers, pre-releases (rc, > beta, > >>> etc) with alphanumerics, and therefore 0 by virtue of being a release > is > >>> higher than beta2. OSGi uses alphanumerics on the fourth part, other > >>> package managers have their own conventions. Buildr doesn't follow > >>> anything > >>> more complicated than numerical. > >>> > >>> Assaf > >>> > >>> > >>> > >>> > >>>> > >>>> alex > >>>> > >>>> > >>>> On Fri, Feb 6, 2009 at 2:35 PM, Matthieu Riou <matth...@offthelip.org > >>>> > >>>>> wrote: > >>>>> > >>>> > >>>> Hi guys, > >>>>> > >>>>> The logic in release strips out any letter that comes after the last > >>>>> > >>>> ('.' > >>> > >>>> + > >>>> > >>>>> digit) in a project release number. So something like 1.2-beta will > >>>>> actually > >>>>> be released as 1.2. Sounds to me like a bug but I just wanted to > check > >>>>> before that it wasn't by design, an adoption of the 'no letter in > >>>>> > >>>> releases' > >>>> > >>>>> RubyGem doctrine. > >>>>> > >>>>> Given that the actual goal is only to strip an ending "-SNAPSHOT", > the > >>>>> > >>>> fix > >>>> > >>>>> is pretty straightforward. > >>>>> > >>>>> Cheers, > >>>>> Matthieu > >>>>> > >>>>> > >>>> > >>> >