You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-commits@maven.apache.org by sv...@apache.org on 2020/07/23 14:27:49 UTC

svn commit: r1880210 - in /maven/website/content: guides/introduction/introduction-to-dependency-mechanism.html maven-site-1.0-site.jar

Author: svn-site-role
Date: Thu Jul 23 14:27:49 2020
New Revision: 1880210

Log:
Site checkin for project Apache Maven Site

Modified:
    maven/website/content/guides/introduction/introduction-to-dependency-mechanism.html
    maven/website/content/maven-site-1.0-site.jar

Modified: maven/website/content/guides/introduction/introduction-to-dependency-mechanism.html
==============================================================================
--- maven/website/content/guides/introduction/introduction-to-dependency-mechanism.html (original)
+++ maven/website/content/guides/introduction/introduction-to-dependency-mechanism.html Thu Jul 23 14:27:49 2020
@@ -180,16 +180,16 @@ Karl Heinz Marbaise" />
 <p>Another reason to directly specify dependencies is that it provides better documentation for your project: one can learn more information by just reading the POM file in your project.</p>
 <p>Maven also provides <a href="/plugins/maven-dependency-plugin/analyze-mojo.html">dependency:analyze</a> plugin goal for analyzing the dependencies: it helps making this best practice more achievable.</p></section><section>
 <h3><a name="Dependency_Scope">Dependency Scope</a></h3>
-<p>Dependency scope is used to limit the transitivity of a dependency, and also to affect the classpath used for various build tasks.</p>
-<p>There are 6 scopes available:</p>
+<p>Dependency scope is used to limit the transitivity of a dependency and to determine when a dependency is included in a classpath.</p>
+<p>There are 6 scopes:</p>
 <ul>
 <li><b>compile</b><br />This is the default scope, used if none is specified. Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects.</li>
-<li><b>provided</b><br />This is much like <code>compile</code>, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope <code>provided</code> because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.</li>
-<li><b>runtime</b><br />This scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath.</li>
-<li><b>test</b><br />This scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases. This scope is not transitive.</li>
+<li><b>provided</b><br />This is much like <code>compile</code>, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope <code>provided</code> because the web container provides those classes. A dependency with this scope is added to the classpath used for compilation and test, but not the runtime classpath. It is not transitive.</li>
+<li><b>runtime</b><br />This scope indicates that the dependency is not required for compilation, but is for execution. Maven includes a dependency with this scope in the runtime and test classpaths, but not the compile classpath.</li>
+<li><b>test</b><br />This scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases. This scope is not transitive. Typically this scope is used for test libraries such as JUnit and Mockito. It is also used for non-test libraries such as Apache Commons IO if those libraries are used in unit tests (src/test/java) but not in the model code (src/main/java).</li>
 <li><b>system</b><br />This scope is similar to <code>provided</code> except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.</li>
-<li><b>import</b><br />This scope is only supported on a dependency of type <code>pom</code> in the <code>&lt;dependencyManagement&gt;</code> section. It indicates the dependency to be replaced with the effective list of dependencies in the specified POM's <code>&lt;dependencyManagement&gt;</code> section. Since they are replaced, dependencies with a scope of <code>import</code> do not actually participate in limiting the transitivity of a dependency.</li></ul>
-<p>Each of the scopes (except for <code>import</code>) affects transitive dependencies in different ways, as is demonstrated in the table below. If a dependency is set to the scope in the left column, transitive dependencies of that dependency with the scope across the top row will result in a dependency in the main project with the scope listed at the intersection. If no scope is listed, it means the dependency will be omitted.</p>
+<li><b>import</b><br />This scope is only supported on a dependency of type <code>pom</code> in the <code>&lt;dependencyManagement&gt;</code> section. It indicates the dependency is to be replaced with the effective list of dependencies in the specified POM's <code>&lt;dependencyManagement&gt;</code> section. Since they are replaced, dependencies with a scope of <code>import</code> do not actually participate in limiting the transitivity of a dependency.</li></ul>
+<p>Each of the scopes (except for <code>import</code>) affects transitive dependencies in different ways, as is demonstrated in the table below. If a dependency is set to the scope in the left column, a transitive dependency of that dependency with the scope across the top row results in a dependency in the main project with the scope listed at the intersection. If no scope is listed, it means the dependency is omitted.</p>
 <table border="1" class="table table-striped">
 <tr class="a">
 <td align="left"></td>

Modified: maven/website/content/maven-site-1.0-site.jar
==============================================================================
Binary files - no diff available.