Migrating a webapp (Spring and Camel) from Tomcat 7 to Jetty

I've webapp that is currently deployed as a war to Tomcat7. I want migrate this webapp to Jetty. I explored Jetty but looks like there are too many options. The webapp uses Spring MVC and Camel. I'm using Maven to do builds, testing and deployment.

I'm looking for good options to quickly migrate this app to Jetty.

EDIT: My main interest is embedded Jetty. I'm assuming embedded Jetty should work fine with Spring.

Thanks.

Answers


This is what I did to make this work.

  1. 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>
    
  2. Executed maven clean and install

    $mvn clean install -DskipTests

  3. Ran the war file using the Jetty plugin

    $mvn jetty:war-run

  4. In a separate window ran the tests

    $mvn test


If you're using eclipse as your IDE and Maven to build then this FAQ from Eclipse website maybe a good place to start.

With the source code, can you deploy and run in Jetty as described?

Jetty scans its $JETTY_HOME/webapps directory at startup for web applications to deploy

The same should applied regardless of an IDE being involved


Need Your Help

How to enable or disable network card and send packet using Assembly language?

assembly

if i know IRQ number of network card in window XP, How to enable or disable network card and send packet using x86 Assembly language without depending on MASM or other libraries?

Add in a title to the MeanMenu JQuery Responsive Navigation

javascript jquery html css html5

I am currently using the MeanMenu JQuery plugin to create a responsive navigation for my website and I would like to know how can I add in a title name to the navigation once it's in responsive mod...