This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
The following commit(s) were added to refs/heads/master by this push:
new 128bd4d1c [SUREFIRE-2178] clarify classpathDependencyExcludes (#666)
128bd4d1c is described below
commit 128bd4d1cdbf0ae086f3f90f70889d95d5b2f5cb
Author: Konrad Windszus <[email protected]>
AuthorDate: Thu Jun 22 12:00:08 2023 +0200
[SUREFIRE-2178] clarify classpathDependencyExcludes (#666)
Add the info that each item of additionalClasspathElements need to be a
filesystem path
---
.../plugin/surefire/AbstractSurefireMojo.java | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
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 aa2bbff6d..8237a9f4e 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
@@ -232,15 +232,23 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
/**
* The directory containing generated test classes of the project being
tested. This will be included at the
- * beginning of the test classpath. *
+ * beginning of the test classpath.
*/
@Parameter(defaultValue = "${project.build.testOutputDirectory}")
protected File testClassesDirectory;
/**
- * List of dependencies to exclude from the test classpath. Each
dependency string must follow the format
- * <i>groupId:artifactId</i>. For example: <i>org.acme:project-a</i>
- *
+ * List of dependencies to exclude from the test classpath.
+ * Each item is passed as pattern to {@link PatternIncludesArtifactFilter}.
+ * The pattern is matched against the following artifact ids:
+ * <ul>
+ * <li>{@code groupId:artifactId} (Short ID)</li>
+ * <li>{@code groupId:artifactId:type:classifier} (Dependency Conflict
ID)</li>
+ * <li>{@code groupId:artifactId:type:classifier:version} (Full ID)</li>
+ * </ul>
+ * The matching algorithm is described in detail in <a
href="https://maven.apache.org/plugins/maven-assembly-plugin/advanced-descriptor-topics.html#advanced-artifact-matching-in-includes-and-excludes">Advanced
Artifact-Matching</a> for the maven-assembly-plugin. This parameter behaves
the same as the {@code excludes} pattern described there.
+ * The dependency matching is applied to the project dependency IDs
(including transitive ones) <i>after resolving</i>, i.e. excluding
+ * one dependency will not exclude its transitive dependencies!
* @since 2.6
*/
@Parameter(property = "maven.test.dependency.excludes")
@@ -265,6 +273,8 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
/**
* Additional elements to be appended to the classpath.
+ * Each element must be a file system path to a JAR file or a directory
containing classes.
+ * No wildcards are allowed here.
*
* @since 2.4
*/
@@ -2537,10 +2547,10 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
}
/**
- * Return a new set containing only the artifacts accepted by the given
filter.
+ * Return a new set containing only the artifacts not accepted by the
given filter.
*
* @param artifacts The unfiltered artifacts
- * @param filter The filter to apply
+ * @param filter The excludes filter to apply
* @return The filtered result
*/
private static Set<Artifact> filterArtifacts(Set<Artifact> artifacts,
ArtifactFilter filter) {