I\'d like to keep Tomcat\'s context.xml file out of my WAR file\'s META-INF directory if possible. Can this be done with Maven\'s cargo plugin? I can\'t seem to find the c
Eureka! After many days of studying this problem I finally found a very effective solution. The key is to take your Tomcat XML context fragment file and use the
element of cargo to drop it in the conf/Catalina/localhost
directory with the name context.xml.default
. The only downside is that this will make your context definitions available to all web-apps, but this shouldn't really matter only Cargo is using this Tomcat instance thus there is no other web-app.
Here's the configuration:
standalone
${tomcat6.port}
com.myapp
myapp-war
war
${tomcat6.context}
${basedir}/../config/tomcat-context.xml
conf/Catalina/localhost/
context.xml.default
The net result is no more bogus WAR modules for testing only, and no more merging of WARs. Hope this helps somebody.