Maven: log4j.properties exception from dependency

My pom.xml file has 2 dependencies, and both of them have a log4j.properties file. Is there any way to exclude the file depending?

Using this plugin does not help:

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

The warning I get:

[WARNING] Duplicate resources found in [org.apache.hadoop: hasoop-core: 2.XXX, org.apache.hbase: hbase-test: 2-XXX]: [WARNING] log4j.properties

+4
source share
1 answer
 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) 
0
source

Source: https://habr.com/ru/post/1501778/


All Articles