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.

Thanks.

Answers


Can you check this sample pom http://svn.apache.org/repos/asf/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/test/resources/deploy-war-project/pom.xml


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>

Need Your Help

How to add uigesturerecognizer to UIDocumentInteractionController Preview?

ios iphone objective-c uigesturerecognizer uidocumentinteraction

Is it possible to add gesture recogniser to UIDocumentInteractionController? Right now I am not able to add anything on UIDocumentInteractionController preview. Please help how to add gesture recog...

How to add an anchor at the end of paginate url in will_paginate

ruby-on-rails ruby pagination will-paginate

Hello I have a problem while using will paginate gem.I want all pagination to be opened under my anchor tab which is "volunteers".