I'm not sure to use the dependencyManagement in the correct way:
I put range in dependencies so that others components that are using it
can detect conflict on versions. And I want to use dependencyManagement
to fix the version that should be used, as you said to set the preferred
version. What the correct way to do it ?
The second question is on the use of the dependency:analyze-dep-mgt. Can
I use it to detect a conflict ? How can I use the failBuild option ?
Benoit
Brian E. Fox wrote:
DependencyManagment is only used for direct dependencies when you don't
specify a version. Think of it as a preference. If you do specify one,
then depMgt doesn't come into play.
-----Original Message-----
From: Benoit Decherf [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 20, 2008 11:12 AM
To: Maven Users List
Subject: Re: dependencyManagement and conflicts
I still don't understand the useage of dependencyManagement :
* A declare a dependency on log4j [1.2.0,1.3.0) and a
dependencyManagement to force on version 1.2.4
mvn dependency:resolve show that log4j 1.2.14 is resolved.
* B declare a dependency on A and a dependencyManagement to force on
version 1.2.4
mvn dependency:resolve show that log4j 1.2.4
So dependencyManagement surcharge the dependencies declared in the
transitive dependencies but not the direct dependencies. Is it right ?
So, I'd like to know when this type of conflict occurs:
mvn dependency:analyze-dep-mgt -DfailBuild=true -DignoreDirect=false -X
[DEBUG] (s) failBuild = false
[DEBUG] (s) ignoreDirect = true
[DEBUG] (s) project = MavenProject: test:A:1.0-SNAPSHOT @
/home/decherfb/tmp/depMgmt/A/pom.xml
[DEBUG] -- end configuration --
[INFO] [dependency:analyze-dep-mgt]
[INFO] Found Resolved Dependency / DependencyManagement mismatches:
[INFO] Ignoring Direct Dependencies.
[INFO] Dependency: log4j:log4j:jar
[INFO] DepMgt : 1.2.4
[INFO] Resolved: 1.2.14
[INFO] None
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
Why doesn't it fail ? What is the correct way to use this plugin ? I
want to include this check to the release:prepare configuration.
Benoit
Brian E. Fox wrote:
Yes. I think it was mng-1577 that made this intentional change. The
dependencyManagement overrides the transitive versions.
Dependency:analyze-dep-mgt can help you detect these conflicts later.
-----Original Message-----
From: Benoit Decherf [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 12, 2008 11:21 AM
To: Maven Users List
Subject: dependencyManagement and conflicts
Hi,
I have 3 projects with their dependencies:
* A
|- B[1.0]
|- C [1.1]
* B
|- C [1.0]
* C
So here there is a conflict in A for C, and this is what I'm expected:
[INFO] Failed to resolve artifact.
The artifact has no valid ranges
test:C:jar:1.0
Path to dependency:
1) test:A:jar:1.0
2) test:B:jar:1.0
But now, if I define in A a dependencyManagement, I can force the
verson
of C and I don't have any warning about the conflict. Is this normal?
Benoit
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]