You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2018/12/16 16:15:56 UTC

[GitHub] rfscholte commented on a change in pull request #11: [MSHADE-307] adding useDefaultConfiguration flag in ShadeMojo

rfscholte commented on a change in pull request #11: [MSHADE-307] adding useDefaultConfiguration flag in ShadeMojo
URL: https://github.com/apache/maven-shade-plugin/pull/11#discussion_r241986414
 
 

 ##########
 File path: src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java
 ##########
 @@ -823,6 +844,50 @@ private File resolveArtifactSources( Artifact artifact )
             }
         }
 
+        // first check for backward compatibility this is not already configured explicitly
+        boolean addExclusion = true;
+        if ( this.filters != null )
+        {
+            for ( final ArchiveFilter filter : this.filters )
+            {
+                if ( filter.getExcludes() != null
+                        && filter.getExcludes().contains( "META-INF/*.SF" )
+                        && filter.getExcludes().contains( "META-INF/*.DSA" )
+                        && filter.getExcludes().contains( "META-INF/*.RSA" )
+                        && "*:*".equals( filter.getArtifact() ) )
+                {
+                    addExclusion = false;
+                    break;
+                }
+            }
+        }
+        if ( addExclusion )
+        {
+            getLog().debug( "Adding META-INF/*.SF, META-INF/*.DSA and META-INF/*.RSA exclusion" );
+
+            if ( artifacts == null )
+            {
+                artifacts = getArtifactIds();
+            }
+            simpleFilters.add( new SimpleFilter(
+                    getMatchingJars( artifacts , new ArtifactId( "*:*" ) ),
+                    Collections.<String>emptySet(),
+                    new HashSet<String>( Arrays.asList( "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA" ) ) ) );
+        }
+
+        for ( final Filter filter : ServiceLoader.load( Filter.class ) )
 
 Review comment:
   Using ServiceLoader requires a separate JIRA issue, and I wonder if this is going to work. See https://issues.apache.org/jira/browse/MNG-6275

----------------------------------------------------------------
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