rmannibucau 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_r241986606
##########
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:
It must work if the extension is added in plugin dependencies as commonly
done for transformers -
http://openwebbeans.apache.org/meecrowave/meecrowave-maven/index.html#_shading
for example. About the other issue: it can be the case but the issue is to make
the configuration easier, if we don't want of a toggle then the SPI is the
answer so it is the same issue, no?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services