问题
I'm building an executable jar-with-dependencies using maven. My application uses log4j and there's an appropriate log4j.properties file under src/resources.
My problem is that there are other log4j.properties files floating around so when maven builds the jar-with-dependencies, it's grabbing one of those instead of the one I want it to, and skipping any others it finds due to log4j.properties already being included.
Anyone know of a way around this?
回答1:
As per the documentation of jar-with-dependencies, it is a very blunt instrument. For better control, use the maven-shade-plugin, where you can exclude all those unwanted files.
来源:https://stackoverflow.com/questions/8689619/maven-jar-with-dependencies-log4j