I have two projects (P1 & P2) which are using Log4j2 logging. Each of the projects have their separate log4j2.xml placed in src/main/resources directory (according to maven structure).
The issue is, when I run any program in a project (say P1) through my IDE (Eclipse) it picks out the correct log4j2.xml. (May be because Eclipse resolves the classpath properly). But when I run the same program from command line, it picks out the log4j2.xml of project P2.
I have tried multiple time to "clean and install" the maven projects but to no help.
Any ideas?