Have you read this document - http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution
It may help answer some of the questions. -----Original Message----- From: Benjamin Smith-Mannschott [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2008 6:21 AM To: Maven Users List Subject: how, exactly, does maven compare versions Here's what I think I've understood out of my reading and my experimentation: Maven's version numbers have forms like this: major[.minor[.fix]]-[blahblahblah[-buildnr]] Where major, minor, fix are parsed and compared as integers. Assumed to be zero if missing? blahblahblah is parsed and compared asciibetically. buildnr is just a convention. one might think that it's compared numerically, but in fact, it's not. (Maven definitive guide). Ah, but then there are snapshots too. Can we combine some arbitrary text (blahblahblah) with a SNAPSHOT? I don't know, but this works: major[.minor[.fix]]-SNAPSHOT This doesn't: Branchname-SNAPSHOT OtherBranchname-SNAPSHOT (Maven seems to pay attention only to the relative newness of the SNAPSHOT and ignore the Branchname when resolving dependencies. This has forced my to give hard version numbers to in-development branches earlier than I'd like to.) The snapshot expands to something like this: 20080818.084237-2, which seems to include a build number. What happens when the two conflict? i.e. 20080818.010000-2 cmp? 20080818.230000-1 Is this build number also compared asciibetically? (Not that it's likely to matter since the time stamp changes.) So, are the following true? : 1 = 1.0.0 1 < 1.0.1 9.0.0 < 10.0.0 1.0.0 < 1.0.0-01 1.0.0 < 1.0.0-00 1.0.0-Apple-09 < 1.0.0-Zed-01 1.0.0-SNAPSHOT < 1.0.0 1.0.0-SNAPSHOT < 1.0.0-01 What about these: 1.0.0-Anteaters < 1.0.0-Zebras 1.0.1-Anteaters > 1.0.0-Zebras SNAPSHOT < 0.0.0 Anteaters-SNAPSHOT cmp? Zebras-SNAPSHOT I find myself flailing around more than I'd like on questions relating to versioning. (Dependency resolution; Wether to keep my trunks as SNAPSHOTs, and if so of what? Can the maintenance branch stay at 2.3.0- SNAPSHOT, even though the maintenance releases 2.3.0-01 is out already? Is this a misuse of build numbers? Should I sacrifice the last position in the version number instead?) What's missing for me is a rigorous understanding of how maven views version numbers. Surely maven *has* rigorous ideas about this? It would seem to be *the* most central concept in making maven workable. hoping for enlightenment, Ben --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ---------------------------------------------------------------------- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
