Technical blog

July 21, 2008

Running Jetty from a custom port through Maven

Filed under: java — Tags: , — paawak @ 11:40

There are two options:

  • pom.xml:
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>maven-jetty-plugin</artifactId>
                <version>6.1.10</version>
                <configuration>                  
                    ...
                    </scanTargetPatterns>
                    <systemProperties>                      
                        <systemProperty>
                            <name>jetty.port</name>
                            <value>8080</value>
                        </systemProperty>                      
                    </systemProperties>
                </configuration>
            </plugin>
  • command prompt: mvn -Djetty.port=8090 jetty:run

The thing to remember is the command line value will override the value in pom.xml.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress