I am working on a multi-module Maven project, whose structure is like this:
war-module
jar-module
The war-module depends on the jar-module,
In the jar module, exclude the file from the jar:
org.apache.maven.plugins
maven-jar-plugin
2.3.1
log4j.xml
Use the buildhelper plugin to attach the log4j.xml to the build as a separate artifact
org.codehaus.mojo
build-helper-maven-plugin
1.5
attach-artifacts
package
attach-artifact
${project.build.outputDirectory}/log4j.xml
xml
log4j
Now in your war artifact, copy the xml to the output directory:
org.apache.maven.plugins
maven-dependency-plugin
copy
prepare-package
copy
${project.groupId}
your.jar.project.artifactId
${project.version}
xml
log4j
${project.build.outputDirectory}
log4j.xml
But of course it would be easier to just put the file in [web-artifact]/src/main/resources in the first place :-)