Stephen Connolly created MSHADE-152:
---------------------------------------

             Summary: Shade plugin assumes all non-pom dependencies are .zip 
formatted files and should be on the classpath
                 Key: MSHADE-152
                 URL: https://jira.codehaus.org/browse/MSHADE-152
             Project: Maven 2.x Shade Plugin
          Issue Type: Bug
    Affects Versions: 2.0
            Reporter: Stephen Connolly


http://maven.apache.org/plugins/maven-shade-plugin/xref/org/apache/maven/plugins/shade/mojo/ShadeMojo.html#455

This selects from *all* artifacts, even those which are not addedToClasspath, 
e.g. see 
https://github.com/torquebox/jruby-maven-plugins/blob/master/gem-maven-plugin/src/main/resources/META-INF/plexus/components.xml#L89

The net result is that, for example, if you have a dependency of type gem shade 
will barf with the ugly

[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-shade-plugin:2.0:shade (default) on project 
shade-gems: Error creating shaded jar: error in opening zip file 
~/.m2/repository/rubygems/bundler/1.3.4/bundler-1.3.4.gem -> [Help 1]

To my mind, the shade plugin should only shade artifacts that are added to the 
classpath and should ignore all non-classpath artifacts.

Fixing this may result in breaking backwards compatibility if anyone is relying 
on the side-effects of the current broken behaviour, so perhaps the solution is 
to either add a flag, defaulting to false, which would enable the broken 
behaviour or else allow the explicit includes to pull the files back in... in 
any case may require a bump to 3.0 when this issue is fixed

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to