This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git
The following commit(s) were added to refs/heads/master by this push: new 6da7a1d3 [MDEP-957] By default, don't report slf4j-simple as unused (#433) 6da7a1d3 is described below commit 6da7a1d3540a4785f8d7268763da3445830bc63b Author: Elliotte Rusty Harold <elh...@users.noreply.github.com> AuthorDate: Fri Oct 18 21:42:34 2024 +0000 [MDEP-957] By default, don't report slf4j-simple as unused (#433) * [MDEP-957] By default, don't report slf4j-simple as unused --- src/it/projects/analyze/pom.xml | 6 ++++++ .../plugins/dependency/analyze/AbstractAnalyzeMojo.java | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/it/projects/analyze/pom.xml b/src/it/projects/analyze/pom.xml index 013a9798..e3072ae8 100644 --- a/src/it/projects/analyze/pom.xml +++ b/src/it/projects/analyze/pom.xml @@ -52,6 +52,12 @@ <artifactId>maven-model</artifactId> <version>2.0.6</version> </dependency> + <!-- MDEP-957 slf4j-simple is unused but should not be reported --> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-simple</artifactId> + <version>2.0.16</version> + </dependency> </dependencies> <build> diff --git a/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java b/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java index b6eed99c..00d3135e 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java +++ b/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java @@ -216,7 +216,7 @@ public abstract class AbstractAnalyzeMojo extends AbstractMojo { private String[] ignoredUsedUndeclaredDependencies = new String[0]; /** - * List of dependencies that will be ignored if they are declared but unused. The filter syntax is: + * List of dependencies that are ignored if they are declared but unused. The filter syntax is: * * <pre> * [groupId]:[artifactId]:[type]:[version] @@ -225,17 +225,17 @@ public abstract class AbstractAnalyzeMojo extends AbstractMojo { * where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern * segment is treated as an implicit wildcard. * * <p> - * For example, <code>org.apache.*</code> will match all artifacts whose group id starts with + * For example, <code>org.apache.*</code> matches all artifacts whose group id starts with * <code>org.apache.</code>, and <code>:::*-SNAPSHOT</code> will match all snapshot artifacts. * </p> * * @since 2.10 */ - @Parameter - private String[] ignoredUnusedDeclaredDependencies = new String[0]; + @Parameter(defaultValue = "org.slf4j:slf4j-simple::") + private String[] ignoredUnusedDeclaredDependencies; /** - * List of dependencies that will be ignored if they are in not test scope but are only used in test classes. + * List of dependencies that are ignored if they are in not test scope but are only used in test classes. * The filter syntax is: * * <pre> @@ -245,14 +245,14 @@ public abstract class AbstractAnalyzeMojo extends AbstractMojo { * where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern * segment is treated as an implicit wildcard. * * <p> - * For example, <code>org.apache.*</code> will match all artifacts whose group id starts with + * For example, <code>org.apache.*</code> matched all artifacts whose group id starts with * <code>org.apache.</code>, and <code>:::*-SNAPSHOT</code> will match all snapshot artifacts. * </p> * * @since 3.3.0 */ - @Parameter - private String[] ignoredNonTestScopedDependencies = new String[0]; + @Parameter(defaultValue = "org.slf4j:slf4j-simple::") + private String[] ignoredNonTestScopedDependencies; /** * List of project packaging that will be ignored.