One of the annoying things about developing for the web, is the whole cycle of writing code, compiling, deploying, running, debug, write code… etc.
So many development tools, help with this, by automatically exploiting the directory where our WAR was deployed and compiling directly to there. All JSP are copied “on write” to the same directory, and the developer as that warm feeling of never have to wait for a package to be redeployed again.
One way to accomplish this, is using Maven plugin for Jetty6. Just include the following plugin on your pom.xml under the plugins tag:
<plugin> <groupid>org.mortbay.jetty</groupid>
<artifactid>maven-jetty6-plugin</artifactid>
<dependencies>
<dependency>
<groupid>org.apache.geronimo.specs</groupid>
<artifactid>geronimo-j2ee_1.4_spec</artifactid>
<version>1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<configuration>
<scanintervalseconds>10</scanintervalseconds>
</configuration>
</plugin>
After that, just type mvn jetty6:run and your project is automagically deployed on a new instance of Jetty6 which you can access on localhost port 8080. Of course, on the first time, Maven will download the required plugin and it will take a little longer.
If you set your IDE to compile directly to the target directory, the Jetty6 plugin will automatically detect any changes on your java classes, JSP, WEB-INF files, and reload automatticaly.
This plugin has been really helpful on developing web applications for Java here at RUPEAL.
Rui Alves on Tuesday, March 6th, 2007 | Posted in Software Development |