Improve documentation and javadocs
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index 7df9637..7cbe8bb 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -242,7 +242,7 @@
protected File testClassesDirectory;
/**
- * List of dependencies to exclude from the test classpath.
+ * List of dependencies to exclude from the test classpath at runtime.
* Each item is passed as pattern to {@link PatternIncludesArtifactFilter}.
* The pattern is matched against the following artifact ids:
* <ul>
@@ -259,7 +259,7 @@
private String[] classpathDependencyExcludes;
/**
- * A dependency scope to exclude from the test classpath. The scope should be one of the scopes defined by
+ * A dependency scope to exclude from the test classpath at runtime. The scope should be one of the scopes defined by
* org.apache.maven.artifact.Artifact. This includes the following:
* <br>
* <ul>
@@ -276,7 +276,7 @@
private String classpathDependencyScopeExclude;
/**
- * Additional elements to be appended to the classpath.
+ * Additional elements to be appended to the test classpath at runtime.
* Each element must be a file system path to a JAR file or a directory containing classes.
* No wildcards are allowed here.
*
@@ -286,11 +286,11 @@
private String[] additionalClasspathElements;
/**
- * Additional Maven dependencies to be added to the test classpath at runtime
+ * Additional Maven dependencies to be added to the test classpath at runtime.
* Each element supports the parametrization like documented in <a href="https://maven.apache.org/pom.html#dependencies">POM Reference: Dependencies</a>.
* <p>
* Those dependencies are automatically collected (i.e. have their full dependency tree calculated) and then all underlying artifacts are resolved from the repository (including their transitive dependencies).
- * Afterwards the resolved artifacts are filtered to only contain {@code compile} and {@code runtime} scoped ones and appended to the test execution classpath
+ * Afterwards the resolved artifacts are filtered to only contain {@code compile} and {@code runtime} scoped ones and appended to the test classpath at runtime
* (after the ones from {@link #additionalClasspathElements}).
* <p>
* The following differences to regular project dependency resolving apply:
diff --git a/maven-surefire-plugin/src/site/apt/examples/configuring-classpath.apt.vm b/maven-surefire-plugin/src/site/apt/examples/configuring-classpath.apt.vm
index 9ac15fd..ba1a8c7 100644
--- a/maven-surefire-plugin/src/site/apt/examples/configuring-classpath.apt.vm
+++ b/maven-surefire-plugin/src/site/apt/examples/configuring-classpath.apt.vm
@@ -28,7 +28,7 @@
The Default Classpath
- The Surefire plugin builds the test classpath in the following order:
+ The Surefire plugin builds the test classpath at runtime in the following order:
#{if}(${project.artifactId}=="maven-surefire-plugin")
[[1]] The {{{../test-mojo.html#testClassesDirectory}test-classes}} directory
@@ -41,7 +41,7 @@
[[2]] The {{{../integration-test-mojo.html#classesDirectory}classes}} JAR file or directory
#{end}
- [[3]] The project dependencies
+ [[3]] The project dependencies (with all scopes)
[[4]] Additional classpath elements
@@ -55,11 +55,13 @@
Additional Classpath Elements
If you need to put more stuff in your classpath when ${thisPlugin} executes (e.g some funky resources or a container specific JAR),
- we normally recommend you add it to your classpath as a dependency. Consider deploying shared JARs to a private remote repository for your
+ we normally recommend you add it to your classpath as a regular project dependency (with scope <<<test>>>). Consider deploying shared JARs to a private remote repository for your
organization.
- But, if you must, you can use the <<<additionalClasspathElements>>> element to add custom resources/JARs to your classpath.
- This will be treated as an absolute file system path, so you may want use $\{basedir\} or another property combined with a relative path.
+ In case this leads to dependency conflicts usually separating the test classes from the actual test execution into separate Maven modules is the recommended approach then.
+
+ But, if you must, you can use the <<<additionalClasspathElements>>> element to add custom resources/JARs to your test classpath at runtime (without affecting the test classpath used for compilation).
+ The items will be treated as absolute file system paths, so you may want use $\{basedir\} or another property combined with a relative path.
Note that additional classpath elements are added to the end of the classpath, so you cannot use these to
override project dependencies or resources.
diff --git a/pom.xml b/pom.xml
index f56157a..74cf94d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -542,7 +542,7 @@
<jdk>[9,)</jdk>
</activation>
<properties>
- <jvm9ArgsTests>--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.stream=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.base/java.util.regex=ALL-UNNAMED --add-opens java.base/java.nio.channels.spi=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/sun.nio.fs=ALL-UNNAMED --add-opens java.base/sun.nio.cs=ALL-UNNAMED --add-opens java.base/java.nio.file=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED</jvm9ArgsTests>
+ <jvm9ArgsTests>--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.stream=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.base/java.util.regex=ALL-UNNAMED --add-opens java.base/java.nio.channels.spi=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/sun.nio.fs=ALL-UNNAMED --add-opens java.base/sun.nio.cs=ALL-UNNAMED --add-opens java.base/java.nio.file=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED</jvm9ArgsTests>
</properties>
</profile>
<profile>