Alfred’s Computing Weblog

Alfred Java-cored Computing Weblog

Posts Tagged ‘jetty

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

Advertisements

Written by Alfred

December 19, 2008 at 19:14

Posted in tomcat

Tagged with ,