views:

39

answers:

0

How do I add an additional directory based context to a tomcat:run configuration?

I have the following jetty plugin configuration:

<build>
  <plugins>
    <plugin>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>maven-jetty-plugin</artifactId>
      <configuration>
        <contextHandlers>
          <contextHandler implementation="org.mortbay.jetty.handler.ContextHandler">
            <contextPath>/media/data</contextPath>
            <resourceBase>/somedir/media/data</resourceBase>
            <handler implementation="org.mortbay.jetty.handler.ResourceHandler" />
          </contextHandler>
        </contextHandlers>
        <contextPath>/</contextPath>
        <webAppSourceDirectory>foo-project/target/foo-webapp</webAppSourceDirectory>
...
      </configuration>
    </plugin>
  </plugins>
...
</build>

How do I do this with tomcat:run?

I have a context.xml file in the tomcatconf dir

<?xml version='1.0' encoding='utf-8'?>
<Context path="/media" docBase="/somedir/media"/>

but this seems to get ignored. I've also tried to explicitly set the contextFile parameter in the plugin configuration, but to no avail.

Reference: http://mojo.codehaus.org/tomcat-maven-plugin/run-mojo.html