Many Java developers complain about the length of time it takes to deploy their webapps for development, or to start the embedded WebTools server in Eclipse, or to use the mvn jetty:run process with Maven.
At work, we’ve created a solution using class which starts up Jetty and gets it to serve your webapp from within the IDE. This means you have start up times of seconds, and can debug without using remote debugging.
Happily, we’ve been able to open source this, too, so people can try it for themselves rather than just here me talk about it.
The source code is here, but you are probably better off using Maven, adding the following repository to your pom.xml:
<repository>
<id>EdAuUtil</id>
<url>http://maven.uat.educationau.edu.au/EdAuUtil</url>
</repository>
and adding the following dependencies:
<dependency>
<groupId>au.edu.educationau.opensource</groupId>
<artifactId>EdAuUtils</artifactId>
<version>0.9</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>6.1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>jasper</artifactId>
<version>6.0.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-ant</artifactId>
<version>0.8</version>
<scope>test</scope>
</dependency>
Then you can run the class au.edu.educationau.opensource.devsupport.TestWebServer from your IDE. I need to generate the javadocs and put them up somewhere, but for the moment the code is reasonably well documented.