Change Jetty Server Running Port

Jetty is one one of the best development server which I have ever used. It is easy to work with jetty server and its light weight

Here I am going to show how to change jetty server running port.  Jetty server default running port is 8080.

Port with Maven: 

  1.  Command line:
  2.          For starting jetty server we are using mvn jetty:run command. We can change the port jetty server running by passing run time argument to it.

             mvn -Djetty.port=80 jetty:run


  3.  Using pom.xml

                By changing jetty plugin system properties as below, you can change the jetty running port.
   <plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>maven-jetty-plugin</artifactId>
    <configuration>
     <stopPort>9966</stopPort>
     <stopKey>foo</stopKey>
     <systemProperties>
      <systemproperty>
       <name>jetty.port</name>
       <value>80</value>
      </systemproperty>
     </systemProperties>
    </configuration>
   </plugin>

Using this method you can run multiple instances of jetty as well.

Comments

Neil Morgan said…
Thanks for taking the time to discuss this I feel strongly about it and love learning more on this topic. If possible as you gain expertise would you mind updating your blog with more information? as it is extremely helpful for me. vonage
Anonymous said…
Thanks... was really helpful.
Anonymous said…
Thanks... was really helpful.
Unknown said…
Mohegan Sun, Casino at Virgin Hotels - Air Jordan 5 Retro
Mohegan Sun, air jordan 18 retro red suede store Casino show to get air jordan 18 retro at Virgin Hotels - 승무패 사이트 8/6/2021 - Mohegan Sun: Click to 벳 매니아 See. 먹튀사이트

Popular posts from this blog

Yield Price Sri Lanka - Android Application

Building a RESTFul Service using Spring Boot

XSLT - Modify Date and DateTime value