Skip to content

Commit 6da7a1d

Browse files
authored
[MDEP-957] By default, don't report slf4j-simple as unused (#433)
* [MDEP-957] By default, don't report slf4j-simple as unused
1 parent cc3ed0f commit 6da7a1d

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/it/projects/analyze/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
<artifactId>maven-model</artifactId>
5353
<version>2.0.6</version>
5454
</dependency>
55+
<!-- MDEP-957 slf4j-simple is unused but should not be reported -->
56+
<dependency>
57+
<groupId>org.slf4j</groupId>
58+
<artifactId>slf4j-simple</artifactId>
59+
<version>2.0.16</version>
60+
</dependency>
5561
</dependencies>
5662

5763
<build>

src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public abstract class AbstractAnalyzeMojo extends AbstractMojo {
216216
private String[] ignoredUsedUndeclaredDependencies = new String[0];
217217

218218
/**
219-
* List of dependencies that will be ignored if they are declared but unused. The filter syntax is:
219+
* List of dependencies that are ignored if they are declared but unused. The filter syntax is:
220220
*
221221
* <pre>
222222
* [groupId]:[artifactId]:[type]:[version]
@@ -225,17 +225,17 @@ public abstract class AbstractAnalyzeMojo extends AbstractMojo {
225225
* where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern
226226
* segment is treated as an implicit wildcard. *
227227
* <p>
228-
* For example, <code>org.apache.*</code> will match all artifacts whose group id starts with
228+
* For example, <code>org.apache.*</code> matches all artifacts whose group id starts with
229229
* <code>org.apache.</code>, and <code>:::*-SNAPSHOT</code> will match all snapshot artifacts.
230230
* </p>
231231
*
232232
* @since 2.10
233233
*/
234-
@Parameter
235-
private String[] ignoredUnusedDeclaredDependencies = new String[0];
234+
@Parameter(defaultValue = "org.slf4j:slf4j-simple::")
235+
private String[] ignoredUnusedDeclaredDependencies;
236236

237237
/**
238-
* List of dependencies that will be ignored if they are in not test scope but are only used in test classes.
238+
* List of dependencies that are ignored if they are in not test scope but are only used in test classes.
239239
* The filter syntax is:
240240
*
241241
* <pre>
@@ -245,14 +245,14 @@ public abstract class AbstractAnalyzeMojo extends AbstractMojo {
245245
* where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern
246246
* segment is treated as an implicit wildcard. *
247247
* <p>
248-
* For example, <code>org.apache.*</code> will match all artifacts whose group id starts with
248+
* For example, <code>org.apache.*</code> matched all artifacts whose group id starts with
249249
* <code>org.apache.</code>, and <code>:::*-SNAPSHOT</code> will match all snapshot artifacts.
250250
* </p>
251251
*
252252
* @since 3.3.0
253253
*/
254-
@Parameter
255-
private String[] ignoredNonTestScopedDependencies = new String[0];
254+
@Parameter(defaultValue = "org.slf4j:slf4j-simple::")
255+
private String[] ignoredNonTestScopedDependencies;
256256

257257
/**
258258
* List of project packaging that will be ignored.

0 commit comments

Comments
 (0)