On this page I am trying to capture different designs, problems and solutions around Version Range processing in Mercury project. Please also read the dev@ list discussion on the subject: http://www.mail-archive.com/search?q=mercury+version+range&l=dev%40maven.apache.org
...
Design
Mercury uses a standard OSGi definition of a version range, defined in OSGi core specs 4.1,
page 39 in April-2007 PDF available on OSGi site - http://osgi.org.
The gist of it is:
...
- \[1.2.3, 4.5.6) 1.2.3 <= x < 4.5.6unmigrated-wiki-markup
- \[1.2.3, 4.5.6\] 1.2.3 <= x <= 4.5.6
- (1.2.3, 4.5.6) 1.2.3 < x < 4.5.6
- (1.2.3, 4.5.6] 1.2.3 < x <= 4.5.6
- 1.2.3 1.2.3 <= x
Note |
---|
Please note, that multi-range definition, like *<version>\[1,3),(3,8\]</version>* is gone. |
Dependency Builder flow
Dependency Builder component of Mercury is responsible for
...
Code Block | ||
---|---|---|
| ||
1.2, 1.3-SNAPSHOT, 1.3-alpha-1, 1.3-alpha-2, 1.3-beta-1, 1.3 |
...
Question to answer: what constitutes the *range \ [1.2,1.3)* and how flexible this implementation should be?
Various options:
- 1.2, 1.3-SNAPSHOT, 1.3-alpha-1, 1.3-alpha-2, 1.3-beta-1
- 1.2, 1.3-alpha-1, 1.3-alpha-2, 1.3-beta-1
- 1.2
...
Welcome to the debate I say that a version range should only
resolve to a snapshot if it is included as an explicit boundary. See http://jira.codehaus.org/browse/MNG-3092You may also be interested in the other issues on my hit list for
being able to use version ranges in Maven: http://jira.codehaus.org/browse/MNG-2994http://jira.codehaus.org/browse/MRELEASE-262http://jira.codehaus.org/browse/MRELEASE-318
...
Alternative options
...
To be well rounded we should consider other approaches to dependencies
its worth having a look at how gentoo does versioning with ranges and slots... http://www.gentoo.org/http://devmanual.gentoo.org/general-concepts/dependencies/index.htmlhttp://devmanual.gentoo.org/general-concepts/slotting/index.html
...
Use Cases
Stephen Connolly wrote:
...