Doesn't your IDE let you know when there is a conflict in the transitive
dependencies?
I believe that Eclipse STS does that for us.
Much simpler than using a plug-in, finds it earlier in the process and
avoids adding more stuff to your POM.
When Eclipse finds one, we fix conflicts for 3rd party things like
commons-lang by excluding it from every direct dependency that tries to
drag a version in and providing a library with the one that we want.
http://blog.artifact-software.com/tech/?p=121
Lots of other advantages but avoids the mystery of which commons-lang
actually gets loaded at run-time.
Ron
On 28/10/2011 5:04 PM, KARR, DAVID wrote:
-----Original Message-----
From: Ansgar Konermann [mailto:[email protected]]
Sent: Friday, October 28, 2011 12:15 PM
To: Maven Users List
Subject: Re: Does the "versions" plugin deal with transitive references
to two different versions of an artifact?
Am 28.10.2011 20:07 schrieb "KARR, DAVID"<[email protected]>:
If I have a build with a lot of modules, and I end up with two
transitive
dependency references to "commons-lang", one for version 2.2, and one
for
version 2.4, does the "versions" plugin let me define rules that will
let me
choose either the older or newer version to actually use?
The versions plugin deals with direct dependencies, not transitive
ones.
From the documentation, I would think that "versions:use-latest-
versions"
comes close, but the documentation is vague. It just says "Replaces
any
version with the latest version."
Yes, but only those which are defined in the pom of your project, not
inside
the poms of dependencies referenced by your project.
It just updates the text of the pom file, which cannot be done easily
with
released poms from some maven repository. After all, that's why we have
releases first hand: to count on the released artifacts as
unmodifiable.
To manage transitive dependencies, enable dependency convergence using
maven-enforcer-plugin. You will be notified about version clashes
between
different versions of the same transitive dependency. To remove these
clashes, define<exclusions> for those transitive dependencies you
don't
want in your classpath.
Can you elaborate on this, please? As I've seen in many cases, the plugin
documentation is very rudimentary.
It looks to me like we would need to specify "enforcer:enforce", but how do I
know what this is going to do?
Does the "versions" plugin work with maven 3.x?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--
Ron Wheeler
President
Artifact Software Inc
email: [email protected]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]