@@ -78,15 +78,15 @@ public abstract class AbstractAnalyzeMojo extends AbstractMojo {
7878 private boolean verbose ;
7979
8080 /**
81- * Ignore Runtime/Provided/Test/System scopes for unused dependency analysis.
81+ * Ignore runtime/provided/test/system scopes for unused dependency analysis.
8282 * <p>
8383 * <code><b>Non-test scoped</b></code> list will be not affected.
8484 */
8585 @ Parameter (property = "ignoreNonCompile" , defaultValue = "false" )
8686 private boolean ignoreNonCompile ;
8787
8888 /**
89- * Ignore Runtime scope for unused dependency analysis.
89+ * Ignore runtime scope for unused dependency analysis.
9090 *
9191 * @since 3.2.0
9292 */
@@ -211,13 +211,18 @@ public abstract class AbstractAnalyzeMojo extends AbstractMojo {
211211 * segment is treated as an implicit wildcard. *
212212 * <p>
213213 * For example, <code>org.apache.*</code> matches all artifacts whose group id starts with
214- * <code>org.apache.</code>, and <code>:::*-SNAPSHOT</code> will match all snapshot artifacts.
214+ * <code>org.apache.</code>, and <code>:::*-SNAPSHOT</code> matches all snapshot artifacts.
215215 * </p>
216216 *
217+ * <p>Certain dependencies that are known to be used and loaded by reflection
218+ * are always ignored. This includes {@code org.slf4j:slf4j-simple::}.</p>
219+ *
217220 * @since 2.10
218221 */
219- @ Parameter (defaultValue = "org.slf4j:slf4j-simple::" )
220- private String [] ignoredUnusedDeclaredDependencies ;
222+ @ Parameter
223+ private String [] ignoredUnusedDeclaredDependencies = new String [0 ];
224+
225+ private String [] unconditionallyIgnoredDeclaredDependencies = {"org.slf4j:slf4j-simple::" };
221226
222227 /**
223228 * List of dependencies that are ignored if they are in not test scope but are only used in test classes.
@@ -361,6 +366,7 @@ private boolean checkDependencies() throws MojoExecutionException {
361366
362367 ignoredUnusedDeclared .addAll (filterDependencies (unusedDeclared , ignoredDependencies ));
363368 ignoredUnusedDeclared .addAll (filterDependencies (unusedDeclared , ignoredUnusedDeclaredDependencies ));
369+ ignoredUnusedDeclared .addAll (filterDependencies (unusedDeclared , unconditionallyIgnoredDeclaredDependencies ));
364370
365371 if (ignoreAllNonTestScoped ) {
366372 ignoredNonTestScope .addAll (filterDependencies (nonTestScope , new String [] {"*" }));
0 commit comments