Maven build [WARNING] we have a duplicate class

前端 未结 8 1243
醉话见心
醉话见心 2020-12-03 16:30

Anybody has any idea what happened to my maven build? I am getting a lot of duplicate warnings.

[WARNING] We have a duplicate org/apache/commons/logging/impl         


        
相关标签:
8条回答
  • 2020-12-03 17:33

    You might also have run into a limitation of maven-shader-plugin. It replaces the default jar artifact (created by maven-jar-plugin). This works fine on a clean build, but on a rebuild where the jar is not regenerated, the shader runs again on the jar it created last time, which already contains copies of all the class dependencies. That produces a lot of warnings about duplicates.

    This issue is still unaddressed as of maven-shader-plugin 2.0: https://issues.apache.org/jira/browse/MSHADE-126

    One workaround is to add the maven-jar-plugin explicitly to your pom.xml and add the configuration setting <forceCreation>true</forceCreation>.

    0 讨论(0)
  • 2020-12-03 17:36

    You have dependencies in your pom which contain duplicate classes but without the appropriate pom i couldn't say a word about it.

    0 讨论(0)
提交回复
热议问题