我的pom.xml文件有2个依赖项,它们都有log4j.properties文件。有没有办法在依赖项中排除文件?
使用此插件无济于事:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3</version>
<configuration>
<excludes>
<exclude>**/log4j.properties</exclude>
</excludes>
</configuration>
</plugin>
我收到的警告:
[警告]在[org.apache.hadoop:hadoop-core:2.XXX,org.apache.hbase:hbase-test:2-XXX]中找到重复的资源: [警告] log4j.properties
答案 0 :(得分:0)
1. go to your pom choose Dependency Hierarchy tab
2.enter the jar name you want (log4j)
3.see if they are at the same version (you are expecting more then one)
4.exclude whatever you don't need (you can right click to exclude)