This is an automated email from the ASF dual-hosted git repository.

sjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 76d59f0  [MDEP-789] Improve documentation of analyze - Non-test scoped
76d59f0 is described below

commit 76d59f0ffe8ab02757cb9c9d131004b6145a7ceb
Author: Slawomir Jaranowski <[email protected]>
AuthorDate: Mon Feb 14 00:14:57 2022 +0100

    [MDEP-789] Improve documentation of analyze - Non-test scoped
---
 .../plugins/dependency/analyze/AbstractAnalyzeMojo.java  |  4 +++-
 .../exclude-dependencies-from-dependency-analysis.apt.vm | 16 +++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java
 
b/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java
index 23c58f2..41d853f 100644
--- 
a/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java
+++ 
b/src/main/java/org/apache/maven/plugins/dependency/analyze/AbstractAnalyzeMojo.java
@@ -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;
@@ -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]
diff --git 
a/src/site/apt/examples/exclude-dependencies-from-dependency-analysis.apt.vm 
b/src/site/apt/examples/exclude-dependencies-from-dependency-analysis.apt.vm
index fa04f07..706127f 100644
--- a/src/site/apt/examples/exclude-dependencies-from-dependency-analysis.apt.vm
+++ b/src/site/apt/examples/exclude-dependencies-from-dependency-analysis.apt.vm
@@ -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>
@@ -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>
@@ -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>

Reply via email to