You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mark Hansen <ma...@javector.com> on 2007/04/03 19:15:26 UTC

Configuring Log4J Differently within Maven for JUnit Testing and Production

I use Log4J and build my applications with Maven2.  I have a log4j.xml 
config file in the src/main/resources directory so that Maven2 builds it 
into the JAR with my application.

However, I have a different log4j.xml that I want to use with the JUnit 
tests that run as part of my Maven build process.  I'd like to put that 
log4j.xml (testing) in the src/test/resources directory and have it 
overide the production version in src/main/resources.  However, Maven 
doesn't seem to work that way.  Instead, the production version of 
log4j.xml seems to come first on the testing classpath and therefore 
gets loaded instead of the testing version of log4j.xml.

I'm sure others must have faced this issue.  Are there any recommended 
solutions to the problem?

Thanks,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org