rfscholte commented on a change in pull request #7: [MPIR-375] add plugin 
excludes feature for plugin-management report
URL: 
https://github.com/apache/maven-project-info-reports-plugin/pull/7#discussion_r247358392
 
 

 ##########
 File path: 
src/main/java/org/apache/maven/report/projectinfo/PluginManagementReport.java
 ##########
 @@ -255,5 +283,41 @@ public int compare( Plugin a1, Plugin a2 )
                 }
             };
         }
+        
+        private boolean isExcluded( Artifact pluginArtifact )
+        {
+            if ( excludes == null )
+            {
+                return false;
+            }
+
+            for ( String pattern : excludes )
+            {
+                String[] subStrings = pattern.split( ":" );
+                subStrings = StringUtils.stripAll( subStrings );
+                String resultPattern = StringUtils.join( subStrings, ":" );
+
+                if ( compareDependency( resultPattern, pluginArtifact ) )
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+        /**
+         * Compares the given pattern against the given artifact. The pattern 
should follow the format
+         * <code>groupId:artifactId:type:classifier:version</code>.
+         * 
+         * @param pattern The pattern to compare the artifact with.
+         * @param artifact the artifact
+         * @return <code>true</code> if the artifact matches the pattern
+         */
+        protected boolean compareDependency( String pattern, Artifact artifact 
)
+        {
 
 Review comment:
   Use org.apache.maven.shared.artifact.filter.PatternExcludesArtifactFilter 
instead

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to