tomcat7-maven-plugin custom server.xml
I am trying to use the tomcat7-maven-plugin:run with a custom server.xml, which contains a Realm I need to enable. As described in the docs I have used <serverXml /> to point to my file. However, my application does not then get loaded. The plugin docs state that I need to configure the context for my application manually.
How do I do this? I am unsure what to put for the docBase etc.
If all you need is change the Realm then instead of using server.xml use context.xml with your realm:
<Context> <Realm className="org.apache.catalina.realm.MemoryRealm" /> </Context>
Point your tomcat maven plugin to that context.xml:
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat6-maven-plugin</artifactId> <version>2.0</version> ... <configuration> ... <contextFile>tomcat/context.xml</contextFile> ... </configuration> </plugin>