This commit is contained in:
Jason van Zyl 2005-10-13 02:47:43 +00:00
parent a06a4da5ce
commit 44779c4da6
2 changed files with 50 additions and 39 deletions

View File

@ -1,14 +1,17 @@
<document> ------
<properties> Introduction to the Dependency Mechanism
<title>Dependency Mechanism</title> ------
<author email="brett@apache.org">Brett Porter</author> Brett Porter
<author email="trygvis@apache.org">Trygve Laugstol</author> Trygve Laugstol
</properties> ------
<body> 12 October 2005
<section name="Dependency Mechanism"> ------
<p>
There are many aspects to working with dependencies in Maven. While it is not the sole focus of Maven, it Introduction to the Dependency Mechanism
does comprise a large and important part of the system. Learn more about:
There are many aspects to working with dependencies in Maven. While it is not the sole focus of Maven, it
does comprise a large and important part of the system. Learn more about:
<ul> <ul>
<li> <li>
<a href="#transitive_dependencies">Transitive Dependencies</a> <a href="#transitive_dependencies">Transitive Dependencies</a>
@ -151,7 +154,8 @@
</p> </p>
<p> <p>
Project A: Project A:
<source><![CDATA[ +----+
<project> <project>
... ...
<dependencies> <dependencies>
@ -174,9 +178,14 @@
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project>]]></source> </project>
Project B:
<source><![CDATA[ +----+
Project B:
+----+
<project> <project>
... ...
<dependencies> <dependencies>
@ -195,12 +204,14 @@
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project>]]></source> </project>
</p>
<p> +----+
These two example POMs share a common dependency and each has one non-trivial dependency. This information These two example POMs share a common dependency and each has one non-trivial dependency. This information
can be put in the parent POM like this: can be put in the parent POM like this:
<source><![CDATA[
+----+
<project> <project>
... ...
<dependencyManagement> <dependencyManagement>
@ -232,11 +243,14 @@
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
</project>]]></source> </project>
And then the two child poms would become much simpler:
</p> +----+
<p>
<source><![CDATA[ And then the two child poms would become much simpler:
+----+
<project> <project>
... ...
<dependencies> <dependencies>
@ -249,8 +263,12 @@
<artifactId>artifact-b</artifactId> <artifactId>artifact-b</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
</project>]]></source> </project>
<source><![CDATA[
+----+
+----+
<project> <project>
... ...
<dependencies> <dependencies>
@ -263,14 +281,9 @@
<artifactId>artifact-b</artifactId> <artifactId>artifact-b</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
</project>]]></source> </project>
</p>
<p> +----+
The reference information about the dependency management tags is available from the
<a href="maven-model/maven.html#class_DependencyManagement">project descriptor reference</a> The reference information about the dependency management tags is available from the
. {{{maven-model/maven.html#class_DependencyManagement}project descriptor reference}}.
</p>
</subsection>
</section>
</body>
</document>

View File

@ -76,8 +76,6 @@ Documentation
* {{{introduction/introduction-to-dependency-management.html}Introduction to Dependency Management}} * {{{introduction/introduction-to-dependency-management.html}Introduction to Dependency Management}}
* {{{introduction/introduction-to-dependency-mechanism.html}Introduction to the Dependency Mechanism}}
* {{{introduction/introduction-to-repositories.html}Introduction to Repositories}} * {{{introduction/introduction-to-repositories.html}Introduction to Repositories}}
* {{{introduction/introduction-to-the-lifecycle.html}Introduction to the Build Lifecycle}} * {{{introduction/introduction-to-the-lifecycle.html}Introduction to the Build Lifecycle}}