maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] rfscholte commented on a change in pull request #7: [MPIR-375] add plugin excludes feature for plugin-management report
Date Sun, 13 Jan 2019 19:03:20 GMT
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message