Running Jetty from a custom port through Maven

Posted by {"name"=>"Palash Ray", "email"=>"paawak@gmail.com", "url"=>"https://www.linkedin.com/in/palash-ray/"} on July 21, 2008 · 1 min read

There are two options:

  • pom.xml:
            
                org.mortbay.jetty
                maven-jetty-plugin
                6.1.10
                
                    ...
                    
                    
                        
                            jetty.port
                            8080
                        
                    
                
            
  • command prompt: mvn -Djetty.port=8090 jetty:run

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