The simplest way I know is to declare in spring or web.xml that the properties are loaded via classpath. For example, in web.xml
log4jConfigLocation
classpath:log4j.xml
Or in spring context file:
classpath:application.properties
classpath:build.properties
Then open tomcat/conf/catalina.properties file and modify the following line:
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/conf
Notice, I added ${catalina.home}/conf at the end of the line.
Now copy the file to tomcat/conf, exclude the file when you package your project. For example, in my application that I am using maven:
src/main/resources
true
application.properties
security.properties
log4j.xml
Then restart tomcat.