Skip to content

Commit

Permalink
[MDEP-789] Improve documentation of analyze - Non-test scoped
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Feb 15, 2022
1 parent b66d2b2 commit 76d59f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Expand Up @@ -98,6 +98,8 @@ public abstract class AbstractAnalyzeMojo

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

/**
* List of dependencies that will be ignored. Any dependency on this list will be excluded from the "declared but
* unused" and the "used but undeclared" list. The filter syntax is:
* unused", the "used but undeclared", and the "non-test scoped" list. The filter syntax is:
*
* <pre>
* [groupId]:[artifactId]:[type]:[version]
Expand Down
Expand Up @@ -34,10 +34,11 @@ Exclude dependencies from dependency analysis
that contain annotations and the byte code analysis is unable to
determine whether a jar is actually required or not.

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

See the following POM configuration for an example:

+---+
<project>
Expand All @@ -57,7 +58,7 @@ Exclude dependencies from dependency analysis
<configuration>
<failOnWarning>true</failOnWarning>

<!-- ignore jsr305 for both "used but undeclared" and "declared but unused" -->
<!-- ignore jsr305 for "used but undeclared", "declared but unused", and "non-test scoped" -->
<ignoredDependencies>
<ignoredDependency>com.google.code.findbugs:jsr305</ignoredDependency>
</ignoredDependencies>
Expand All @@ -71,6 +72,11 @@ Exclude dependencies from dependency analysis
<ignoredUnusedDeclaredDependencies>
<ignoredUnusedDeclaredDependency>com.google.code.findbugs:annotations</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>

<!-- ignore annotations for "non-test scoped" warnings -->
<ignoredNonTestScopedDependencies>
<ignoredNonTestScopedDependency>com.google.code.findbugs:annotations</ignoredNonTestScopedDependency>
</ignoredNonTestScopedDependencies>
</configuration>
</execution>
</executions>
Expand Down

0 comments on commit 76d59f0

Please sign in to comment.