I have two context.xml files in my Java web project:
context.xml.development context.xml.production
and I use maven war plugin to build it.
When I build the project, I'd like maven to copy the proper context.xml to the META-INF directory.
How could I do it? I'm already using profiles in my pom.xml
A combination of maven build profiles and the maven-war-plugin using file filtering to include or exclude the correct files should do the trick.
For example, something like this:
Then when you run maven be sure to sent the "environment" property appropriately:
mvn clean install -Denvironment=production