Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Maven shade plugin build fails without 'clean' goal #961

Closed
SylvainJuge opened this issue Dec 6, 2019 · 1 comment · Fixed by #2109
Closed

Maven shade plugin build fails without 'clean' goal #961

SylvainJuge opened this issue Dec 6, 2019 · 1 comment · Fixed by #2109
Labels

Comments

@SylvainJuge
Copy link
Member

Describe the bug

Build with the package goal fail if there is no clean goal executed.

It seems that maven-shade-plugin is not able to properly handle a resource file, thus the root cause is likely in the maven-shade-plugin project.

Error creating shaded jar: duplicate entry: META-INF/services/co.elastic.apm.agent.shaded.stagemonitor.configuration.ConfigurationOptionProvider

How to reproduce

  • execute first build: mvn clean package -DskipTests -Dmaven.javadoc.skip=true
  • try to execute another build without clean will fail mvn package -DskipTests -Dmaven.javadoc.skip=true

Workaround

Always execute the clean goal makes it work, but means doing extra work as the project is re-built from scratch.

@tisonkun
Copy link

tisonkun commented Sep 3, 2022

Here apache/maven-shade-plugin#150 is the fix for upstream. I've verified locally. If you're still interested in this issue, please react an emoji to prioritize it :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants