Hi Jan,
See also https://github.com/apache/maven-shade-plugin/pull/14 and MSHADE-259

I stalled on it because it appears to be a lot of work to create unit tests for 
maven plugins — and there weren’t examples to follow in the shade plugin.
That said, I’m not sure what I did is the right way to fix it.  I’ve seen 
emails go by that indicate the possibility of duplication in attachment lists 
affects several plugins, and the best way would be a global change in the 
underlying methods for “attachArtifact” that checks to see if the requested 
item is already there and not duplicate it if so (without error).

Regards,
—Matt

On Nov 28, 2019, at 7:03 AM, Jan Lukavský <je...@seznam.cz> wrote:

Hi Maven :),

I encountered an exception in my build and I'm not sure if there is something 
wrong with how I structure tasks in my pom.xml, or there is a room for 
improvement of the shade plugin.

The symptoms are as follows:

 - mvn install works just fine

 - mvn deploy fails on 'duplicate error: META-INF/service/....' while shading 
test jar

The reason for that seems that it includes the regular (not test-jar), and that 
one already includes the shaded service. When shading with the other 
dependencies, this fails. I managed to fix this locally with [1], but I'm not 
sure if this is a proper fix. I didn't fill any JIRA yet, because I wanted to 
check with you what the best solution should look like. I also don't know when 
or how this broke, but at least somewhat in early 2019 this worked. I probably 
changed the shade plugin to latest version later this year.

Thanks for comments and suggestions!

Jan

[1] https://github.com/apache/maven-shade-plugin/pull/32


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org


Reply via email to