Basically, for when your developing a webapp and need a quick test of it, then jetty comes to the rescue. Simply drop the following configuration into your webapp's pom.xml:
Then from the command line run:
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
</plugins>
</build>
mvn jetty:runThis will start up jetty and run from the target/${build.finalName} directory - this means that as you continue developing Jetty is updated with the changes you make as you rebuild your artifact.
Pretty cool! This plugin obviously comes with a whole bunch of configuration options, but in it's default state it suits most of my needs. The only configuration I usually use is to update the port that Jetty is hosted on, this following config does that for you, updating the port to :8081
More details on the plugin can be found at http://www.mortbay.org/maven-plugin
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8081</port>
</connector>
</connectors>
</configuration>
</plugin>
which covers more configuration options you can shake a stick at!
I've been using this whilst developing Apache Tuscany enabled webapps, it really has improved my turnaround, so I thought it'd be useful to share!
No comments:
Post a Comment