For
<dependencies>
...
<dependency>
<groupId>com.manuel.jordan</groupId>
<artifactId>some module</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
...
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<id>create-fat-jar</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>somename</finalName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
该插件运行良好,但总是出现此消息:
[WARNING] moduleA-0.0.1-SNAPSHOT.jar,
moduleB-0.0.1-SNAPSHOT.jar,
.... more
moduleN-0.0.1-SNAPSHOT.jar define 1 overlapping resource:
[WARNING] - META-INF/MANIFEST.MF
[WARNING] maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See http://maven.apache.org/plugins/maven-shade-plugin/
如何修复以删除该警告消息?,这主要是因为我的所有模块都没有META/MANIFEST.MF
文件在他们的src/main/resources
目录
在配置中添加此内容将从构建中排除资源文件
<filters>
<filter>
<artifact>org.example:*</artifact>
<excludes>
<exclude>META-INF/*.MF</exclude>
</excludes>
</filter>
</filters>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)