Running Jetty 9 with Maven

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

Running Jetty through Maven is super simple. The only problem is lot of configurations were changed in Jetty 9. It is significantly different from, say, Jetty 6. I will keep it short. The below lines in pom.xml would get the job done:

			
				org.eclipse.jetty
				jetty-maven-plugin
				9.3.5.v20151012
				
					90
					
						/${project.name}
					
					
						8090
					
				
			

Note that it defines a custom port and a context path as well.
Use the below command to run Jetty:

mvn jetty:run

The sources are available here:
https://github.com/paawak/blog/tree/master/code/simple-spring-rest