5

我的 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

4

1 回答 1

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)
于 2013-09-12T07:35:03.863 回答