Maven build [WARNING] we have a duplicate class

前端 未结 8 1267
醉话见心
醉话见心 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 true.

提交回复
热议问题