Webapp migration (Spring and Camel) from Tomcat 7 to Jetty

I have a webapp that is currently being used as a war with Tomcat7. I want to port this webapp to Jetty. I researched Jetty, but there seem to be too many options. Webapp uses Spring MVC and Camel. I use Maven to build, test, and deploy.

I am looking for good options for quickly migrating this application to Jetty.

EDIT: My main interest is the built-in Jetty. I assume that embedded Jetty should work fine with Spring.

Thank.

+3
source share
2 answers

This is what I did to make this work.

  • I added the following plugin to my pom.xml

        <!-- plugin so you can run mvn jetty:war-run -->
        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>7.5.4.v20111024</version>
    
    
            <configuration>
                <scanIntervalSeconds>10</scanIntervalSeconds>
                <webAppConfig>
                    <contextPath>/mycontextpath</contextPath>
                </webAppConfig>
                <configuration>
                    <webApp>${basedir}/target/{mywarname}.war</webApp>
                </configuration>
                <connectors>
                    <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                        <port>8080</port>
                        <maxIdleTime>60000</maxIdleTime>
                    </connector>
                </connectors>
            </configuration>
        </plugin>
    
  • Done maven clean and install

    $ mvn clean install -DskipTests

  • Jetty

    $mvn jetty: war-run

  • $mvn test

+3

eclipse IDE Maven , Eclipse, , .

Jetty, ?

Jetty $JETTY_HOME/webapps -

IDE

0

All Articles