On 13/08/2008, at 10:51 AM, Oleg Gusakov wrote:
Working on Mercury I faced the necessity to use some standard
definition of a "version range", so I took OSGi definition: OSGi
core specs 4.1, page 39 in April-2007 PDF available on OSGi site - http://osgi.org
.
Some interesting ramifications for Maven users:
1). Declaration 1.2.3 means any version X, greater or equal to
1.2.3: 1.2.3 <= X. We are used to a soft version of that in Maven
builds - version can be replaced by a more applicable dependency.
But spec states ANY version: i.e. found in any scanned repository.
This one seems the most unintuitive. OSGi apps work in a different
context, where you constrain the search set to things you've already
chosen, not the repository of all available versions.
We put this into an early alpha/beta of m2 and there was a revolt :)
However, a lot of that could have been attributed to a mostly m1-built
repo and a non-transitive m1-mindset.
I think it makes sense in a transitive situation, but if you have a
specific version in the source POM it's a bit confusing. What I would
see happening in this situation is that we'd have to stop recommending
using this type of specification and ask for explicit ranges to be used.
The only place we've always differed from OSGi was the qualifier -
since the qualifier goes in the other direction from the release than
we expect. I assume from your comment below we retain that behaviour?
2). I strongly feel that failing any explicit ranges, containing
snapshots is a good thing. For instance, dependency declaration 1.2-
SNAPSHOT is a range by definition, so I'd rather fail anything like
[1.2-SNAPSHOT,2.0) or [1.0,1.2-SNAPSHOT)
3). Declaration [2.0, 2.1) should exclude 2.1-SNAPSHOT, but include
2.1-alpha-1, etc
+1
Just to be sure I understood - if you use a snapshot, you always get
that snapshot. If you don't, you never get a snapshot?
Thanks,
Brett
--
Brett Porter
[EMAIL PROTECTED]
http://blogs.exist.com/bporter/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]