I am creating an uber jar using maven assembly plugin. One of the dependencies of my program is an application that can launch either by launching inside my program via a thread or can be launched independently as it is its own uberjar.
My problem is that both applications use log4j2 and both have a log4j2.xml in the resources folder. When maven makes my applications uberjar it overwrites my applications log4j.xml configuration file with the one from the dependency. Is there a way around this while still allowing both applications to have the config file in the resources folder?
When Log4j starts it will locate the configuration with a weighted order from highest to lowest:
So the easiest would be to move the your log4j.xml to a subfolder in your resources dir and define this one using the property "log4j.configurationFile". Otherwise just switch to a property base config file "log4j2.properties". Maybe this converter can help you.
Please also have a look at the documentation (that's where I got this list from).