[
https://issues.apache.org/jira/browse/MDEP-957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17889024#comment-17889024
]
ASF GitHub Bot commented on MDEP-957:
-------------------------------------
slawekjaranowski commented on code in PR #433:
URL:
https://github.com/apache/maven-dependency-plugin/pull/433#discussion_r1798476056
##########
src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java:
##########
@@ -228,11 +228,15 @@ public abstract class AbstractAnalyzeMojo extends
AbstractMojo {
* For example, <code>org.apache.*</code> will match all artifacts whose
group id starts with
* <code>org.apache.</code>, and <code>:::*-SNAPSHOT</code> will match all
snapshot artifacts.
* </p>
+ * <p>
+ * By default, org.slf4j:slf4j-simple is ignored. Setting this property to
an empty list
+ * will allow it to be detected.
+ * </p>
*
* @since 2.10
*/
@Parameter
- private String[] ignoredUnusedDeclaredDependencies = new String[0];
+ private String[] ignoredUnusedDeclaredDependencies =
{"org.slf4j:slf4j-simple::"};
Review Comment:
1. why not use a `default` option of parameter?
2. when user defined another ignores list it will be overridden ... maybe we
need add it latter to be always ignored ...
> Special case slf4j-simple et al to not report used but undeclared
> -----------------------------------------------------------------
>
> Key: MDEP-957
> URL: https://issues.apache.org/jira/browse/MDEP-957
> Project: Maven Dependency Plugin
> Issue Type: New Feature
> Reporter: Elliotte Rusty Harold
> Assignee: Elliotte Rusty Harold
> Priority: Major
>
> Originally reported in
> https://issues.apache.org/jira/browse/MSHARED-1204?filter=-1
> slf4j-simple is often deliberately added to classpaths to shut up annoying
> warnings from SLF4J at run and test time, even though it isn't absolutely
> required. Can we do better with our analysis of the common case and similar
> ones, rather than reporting it as declared but unused?
> ```
> <dependency>
> <groupId>org.slf4j</groupId>
> <artifactId>slf4j-simple</artifactId>
> <scope>test</scope>
> </dependency>
> ```
--
This message was sent by Atlassian Jira
(v8.20.10#820010)