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 correct configuration.
相关问题
- Tomcat and SSL Client certificate
- Include pom.xml in Jar with gradle
- Can't configure nginx as a proxy for tomcat wi
- What order does maven find its dependencies?
- proguard causing EnumMap NPE on dynamically declar
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
<configfiles>
element of cargo to drop it in theconf/Catalina/localhost
directory with the namecontext.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:
The net result is no more bogus WAR modules for testing only, and no more merging of WARs. Hope this helps somebody.
I haven't found a way to do this yet, but I have come up with a work around that works in my project. I currently have a project with essentially 3 submodules:
When I'm building the "webapp" project, I execute the following plugin declaration:
And then when I'm running my Cargo/WebTest suite in the SmokeTest project, I specify the smoketest WAR file as a dependency and in my Cargo configuration set my deployrables thusly:
With the dependency looking something like:
It's extremely dirty, but it at least works... for now. One quick note: my comment about forcing it to never look for a version in the repo is possibly incorrect at this point; I think this trick may have been broken by a change to the dependency plugin at some point.