Sat in on Freenode #maven for a bit tonight to see if I could sort some of this out.
Brian Fox of the Maven PMC was very helpful; I'll attach some relevant snippets below
and a link to the full (edited for brevity) transcript at the end.
"dimitris(a)jboss.org" wrote : I'm surprised maven doesn't understand
versioning (1.0.1 > 1.0.0)
"#maven" wrote : Brian: Will Maven know that 1.0.0 is less than 1.0.1? ->
yes.
| Brian: the next thing: The fundamental problem is that maven has no idea that 1.0.1 is
after 1.0.0 ... isn't true
---
"adrian(a)jboss.org" wrote : Now which version of common-core gets used?
| The answer is common-core:1.0.1 because jbossmc is first in the list
"#maven" wrote : Brian: "The answer is common-core:1.0.1 because jbossmc is
first in the list" ... is also not true
| ALR: "Closest wins", you mean.
| Brian: it will use 1.0.1 because it's comparing at the same level
| Brian: right. closest wins applies first
---
Some additional insight that might help us:
"#maven" wrote : Brian: ok, so a few things that might not be known..
| ALR: All ears.
| Brian: dependencyManagement will apply to transitive dependencies since 2.0.6
| Brian: so your common-core thing... if you put that in depMgt, all that first
discussion goes away. it will be what you set (provided it's not defined anywhere
else)
This is the main suggestion; use "dependencyManagement" more frequently than
simple "dependency".
"#maven" wrote : Brian: the other thing to know, specifying a version like
"1.0" is just a suggestion
| Brian: technically the range is [,] with a recommendation on 1.0
| Brian: so that means that [1.0] is very different.
| Brian: so that's another way to influence the resolution. It's probably not
the best way to do it though
| ALR: Meaning, "[1.0]" is concrete.
| ALR: And "1.0" is suggested?
| Brian: correct
| Brian: 1.0 means you want 1.0 but it lets maven have the flexibility to choose
| Brian: [1.0] means that's the only thing you can get. It _should_ either give you
1.0 or fail the build because there's a conflict
| ALR: And what if we specify [1.0] somewhere, and [1.1] is somewhere else
transitively?
| Brian: it should fail
| ALR: :)
| Brian: i think this is a heavy handed approach that may make things worse
| ALR: Brian: But it gives us fail-fast.
| Brian: yes. You could also use the enforcer for that
So we can also look at locking down versions by placing them in brackets, forcing a
version conflict failure if there's a problem. Brian alludes to some problems here;
I'm not sure in which way these might manifest themselves.
Also worth a look is the Enforcer Plugin
http://maven.apache.org/plugins/maven-enforcer-plugin/.
Edited transcript:
http://www.alrubinger.com/jboss/pound-maven.txt
S,
ALR
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137628#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...