maven and jetty for quick dev deploy

Jetty is a java powered lightweight servlet container. It can be used as an embedded container bringing webapps closer to desktop applications. But that’s another story. Here I will quickly explain how you can even quicker deploy your webapp on a jetty container using the maven jetty plugin.

All you need to do is add some configuration for the jetty plugin in you pom file. Like this basic config:




4.0.0
be.cappelleh.test
test
test
1.0-SNAPSHOT
http://maven.apache.org



org.mortbay.jetty
maven-jetty-plugin

true
10








Next you can run your application using the following goal


mvn jetty:run

First time will take a bit longer because of the dependencies that need to be downloaded. Once up and running you’ll see


[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 10 seconds.

And that means your application is waiting for you at (replace yourContext with your project context)


http://localhost:8080/yourContext

sources:
o jetty project homepage
o maven jetty plugin config
o maven jetty plugin goals
o more on jetty

Leave a Reply

Your email address will not be published. Required fields are marked *

Please reload

Please Wait