You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ca...@apache.org on 2006/11/21 20:10:48 UTC
svn commit: r477827 -
/maven/site/trunk/src/site/apt/guides/introduction/introduction-to-dependency-mechanism.apt
Author: carlos
Date: Tue Nov 21 11:10:47 2006
New Revision: 477827
URL: http://svn.apache.org/viewvc?view=rev&rev=477827
Log:
Improve explanation of Dependency mediation
Modified:
maven/site/trunk/src/site/apt/guides/introduction/introduction-to-dependency-mechanism.apt
Modified: maven/site/trunk/src/site/apt/guides/introduction/introduction-to-dependency-mechanism.apt
URL: http://svn.apache.org/viewvc/maven/site/trunk/src/site/apt/guides/introduction/introduction-to-dependency-mechanism.apt?view=diff&rev=477827&r1=477826&r2=477827
==============================================================================
--- maven/site/trunk/src/site/apt/guides/introduction/introduction-to-dependency-mechanism.apt (original)
+++ maven/site/trunk/src/site/apt/guides/introduction/introduction-to-dependency-mechanism.apt Tue Nov 21 11:10:47 2006
@@ -24,8 +24,6 @@
[]
- <<NOTE:>> <This document is currently in the process of being written, so not all facets are covered.>
-
* Transitive Dependencies
Transitive dependencies are a new feature in Maven 2.0. This allows you to avoid needing to discover and
@@ -43,8 +41,15 @@
* <Dependency mediation>
- this determines what version of a dependency will be used when multiple
- versions of an artifact are encountered. Currently, Maven 2.0 only supports using the "nearest definition" - so
- you can always guarantee a version by declaring it explicitly in your project's POM.
+ versions of an artifact are encountered. Currently, Maven 2.0 only supports using the "nearest definition" which means
+ that it will use the version of the closest dependency to your project in the tree of dependencies.
+ You can always guarantee a version by declaring it explicitly in your project's POM.
+ Note that if two dependency versions are at the same depth in the dependency tree it's not defined which one will win.
+
+ * "nearest definition" means that the version used will be the closest one to your project in the tree of dependencies,
+ eg. if dependencies for A, B, and C are defined as A -> B -> C -> D 2.0 and A -> E -> D 1.0,
+ then D 1.0 will be used when building A because the path from A to D through E is shorter.
+ You could explicitly add a dependency to D 2.0 in A to force the use of D 2.0
* <Dependency scope>
- this allows you to only include dependencies appropriate for the current stage