Alfred’s Computing Weblog

Alfred Java-cored Computing Weblog

Maven + Jetty = Quick Deploy in Developement

leave a comment »

In web application development, that is very common cycle for developer to making code chances, re-deploy application, and test again. The re-deploy process is a huge time-wasting process.

To solve it, I use Jetty (a lightweight servlet container) with Maven to re-compile and re-deploy the web application on the fly! It saves my time 😀

<plugin>
	<groupId>org.mortbay.jetty</groupId>
	<artifactId>maven-jetty-plugin</artifactId>
	<configuration>
	<scanIntervalSeconds>10</scanIntervalSeconds>
	<connectors>
		<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
			<port>8080</port>
			<maxIdleTime>60000</maxIdleTime>
		</connector>
	</connectors>
	<webApp>${basedir}/target/my-web-app-0.1-SNAPSHOT</webApp>
	<requestLog implementation="org.mortbay.jetty.NCSARequestLog">
	<filename>target/yyyy_mm_dd.request.log</filename>
	<retainDays>90</retainDays>
	<append>true</append>
	<extended>false</extended>
	<logTimeZone>GMT</logTimeZone>
	</requestLog>
	</configuration>
</plugin>

To execute Jetty in Maven:
cd to your application path, $> mvn jetty:run

Written by Alfred

December 19, 2008 at 19:14

Posted in tomcat

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: