Superfluous warnings when using maven-shade-plugin

怎甘沉沦 提交于 2019-12-04 00:18:06

This is because it is shading the files into an already shaded jar.

The first time you run package after a clean then it will create the jar. The second time you run it then it doesn't bother as the jar already exists.

From the shade plugins perspective it doesn't know that this has already been shaded so it just tries to add the classes again.

We can force maven to create the jar everytime by configuring the jar plugin:

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-jar-plugin</artifactId>
   <version>2.4</version>
   <configuration>
     <forceCreation>true</forceCreation>
   </configuration>
</plugin>

And this works for me. Either that or just do a clean install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!