[ 
http://jira.codehaus.org/browse/MSHADE-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=145037#action_145037
 ] 

Henrik Johansson commented on MSHADE-30:
----------------------------------------

This is how it goes wrong:
(project is clean)
> mvn package
(there is a shaded jar i target/project.jar)
> mvn package
You get "Embedded error: duplicate entry: ..."

This happens because during the second run shade runs on an already shaded jar, 
which results is the same class being added again. Of course, in bigger 
project's it's not fun to run clean all the time, but it is a workaround.

I will attach a patch, it has the following changes since 1.1.
* Upon composing the shaded jar, it writes an empty text file under: 
META-INF/maven/shaded
* Before shading, it checks if the input jar is already shaded or not. If so, 
it reuses the original-file generated during last run instead of the shaded 
project artifact.
* It does not replace the "old original" from last run with the new shaded jar.


> duplicate entry error
> ---------------------
>
>                 Key: MSHADE-30
>                 URL: http://jira.codehaus.org/browse/MSHADE-30
>             Project: Maven 2.x Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>            Reporter: Michael Mattox
>
> I receive this error:
> Embedded error: duplicate entry: org/apache/xmlbeans/FilterXmlObject.class
> It started with a javax.xml.namespace class.  So I started putting excludes, 
> and then I kept getting one new class after another.  If I exclude everything 
> then I doubt my application is going to work.
> I really don't understand this error.  I have never seen this type of error 
> with the fatjar eclipse plugin.  I understand it's complaining about having 
> the same class twice, but if it's not a problem for my eclipse project or the 
> maven build, why is it a problem for shade?
> I feel the shade plugin should be able to handle this gracefully.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to