Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
<project>
  ...
  <plugins>
    ...
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <configuration>
          <webApp>${basedir}/target/mycustom.war</webApp>
        </configuration>
        <executions>
          <execution>
            <id>start-jetty</id>
            <phase>test-compile</phase>
            <goals>
              <goal>deploy-war</goal>
            </goals>
            <configuration>
              <daemon>true</daemon>
              <reload>manual</reload>
            </configuration>
          </execution>
          <execution>
            <id>stop-jetty</id>
            <phase>test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
  </plugins>
</project>

Anchor
sysprops
sysprops

Running Multiple Webapps

Sometimes you need to deploy a number of webapps, not just the webapp under development. You can do this with the mvn jetty:run goal by supplying extra contextHandlers in the pom configuration.

Here's an example of setting up an extra webapp to run in the same jetty instance as the webapp under development:

Code Block
xml
xml

<project>
  ...
  <plugins>
    ...
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <configuration>
          <webApp>${basedir}/target/myfunkywebapp</webApp>
          <contextHandlers>            
            <contextHandler implementation="org.mortbay.jetty.webapp.WebAppContext">
              <war>${basedir}../../myother.war</war>
              <contextPath>/other</contextPath>
            </contextHandler>
          </contextHandlers>  
        </configuration>
      </plugin>
  </plugins>
</project>

This would deploy both the webapp under development - unassembled - at the context path "/" and a second webapp at the contex path "/other".

Setting System Properties

...

Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery