@@ -78,15 +78,15 @@ public abstract class AbstractAnalyzeMojo extends AbstractMojo {
78
78
private boolean verbose ;
79
79
80
80
/**
81
- * Ignore Runtime/Provided/Test/System scopes for unused dependency analysis.
81
+ * Ignore runtime/provided/test/system scopes for unused dependency analysis.
82
82
* <p>
83
83
* <code><b>Non-test scoped</b></code> list will be not affected.
84
84
*/
85
85
@ Parameter (property = "ignoreNonCompile" , defaultValue = "false" )
86
86
private boolean ignoreNonCompile ;
87
87
88
88
/**
89
- * Ignore Runtime scope for unused dependency analysis.
89
+ * Ignore runtime scope for unused dependency analysis.
90
90
*
91
91
* @since 3.2.0
92
92
*/
@@ -211,13 +211,18 @@ public abstract class AbstractAnalyzeMojo extends AbstractMojo {
211
211
* segment is treated as an implicit wildcard. *
212
212
* <p>
213
213
* 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.
215
215
* </p>
216
216
*
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
+ *
217
220
* @since 2.10
218
221
*/
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::" };
221
226
222
227
/**
223
228
* 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 {
361
366
362
367
ignoredUnusedDeclared .addAll (filterDependencies (unusedDeclared , ignoredDependencies ));
363
368
ignoredUnusedDeclared .addAll (filterDependencies (unusedDeclared , ignoredUnusedDeclaredDependencies ));
369
+ ignoredUnusedDeclared .addAll (filterDependencies (unusedDeclared , unconditionallyIgnoredDeclaredDependencies ));
364
370
365
371
if (ignoreAllNonTestScoped ) {
366
372
ignoredNonTestScope .addAll (filterDependencies (nonTestScope , new String [] {"*" }));
0 commit comments