Override properties file from resource dependency

I have log4j.properties in src / main / resources and there are dependencies that also contain log4j.properties. When I build my project using the maven build plugin, sometimes the log4j.properties is fetched from resources and sometimes from dependencies. I want to be selected every time from the resources.

+3


source to share


1 answer


Instead of excluding log4j.properties files, you can also rename your file and add a system property that points to it. For example: you can rename your file to "my-log4j.properties" and then add the following to the execution line:java ... -Dlog4j.configuration=my-log4j.properties ...



+1


source







All Articles