Skip to content

Commit 76d59f0

Browse files
[MDEP-789] Improve documentation of analyze - Non-test scoped
1 parent b66d2b2 commit 76d59f0

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ public abstract class AbstractAnalyzeMojo
9898

9999
/**
100100
* Ignore Runtime/Provided/Test/System scopes for unused dependency analysis.
101+
*
102+
* <code><b>Non-test scoped</b></code> list will be not affected.
101103
*/
102104
@Parameter( property = "ignoreNonCompile", defaultValue = "false" )
103105
private boolean ignoreNonCompile;
@@ -167,7 +169,7 @@ public abstract class AbstractAnalyzeMojo
167169

168170
/**
169171
* List of dependencies that will be ignored. Any dependency on this list will be excluded from the "declared but
170-
* unused" and the "used but undeclared" list. The filter syntax is:
172+
* unused", the "used but undeclared", and the "non-test scoped" list. The filter syntax is:
171173
*
172174
* <pre>
173175
* [groupId]:[artifactId]:[type]:[version]

src/site/apt/examples/exclude-dependencies-from-dependency-analysis.apt.vm

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ Exclude dependencies from dependency analysis
3434
that contain annotations and the byte code analysis is unable to
3535
determine whether a jar is actually required or not.
3636

37-
The plugin can then be configured to ignore these dependencies in
38-
either "declared but unused" or "undeclared but used" case or in
39-
both simultaneously. See the following POM configuration for an
40-
example:
37+
The plugin can then be configured to ignore dependencies that are
38+
"declared but unused", "undeclared but used", and "non-test scoped"
39+
in selected list or in all simultaneously.
40+
41+
See the following POM configuration for an example:
4142

4243
+---+
4344
<project>
@@ -57,7 +58,7 @@ Exclude dependencies from dependency analysis
5758
<configuration>
5859
<failOnWarning>true</failOnWarning>
5960

60-
<!-- ignore jsr305 for both "used but undeclared" and "declared but unused" -->
61+
<!-- ignore jsr305 for "used but undeclared", "declared but unused", and "non-test scoped" -->
6162
<ignoredDependencies>
6263
<ignoredDependency>com.google.code.findbugs:jsr305</ignoredDependency>
6364
</ignoredDependencies>
@@ -71,6 +72,11 @@ Exclude dependencies from dependency analysis
7172
<ignoredUnusedDeclaredDependencies>
7273
<ignoredUnusedDeclaredDependency>com.google.code.findbugs:annotations</ignoredUnusedDeclaredDependency>
7374
</ignoredUnusedDeclaredDependencies>
75+
76+
<!-- ignore annotations for "non-test scoped" warnings -->
77+
<ignoredNonTestScopedDependencies>
78+
<ignoredNonTestScopedDependency>com.google.code.findbugs:annotations</ignoredNonTestScopedDependency>
79+
</ignoredNonTestScopedDependencies>
7480
</configuration>
7581
</execution>
7682
</executions>

0 commit comments

Comments
 (0)