views:

54

answers:

3

I am developing a war/java website that is built via maven.

Currently, I have to make changes... tell maven to build them... then deploy to Tomcat. This is around 40seconds. So every change I make, I have to wait >=40seconds to see the change.

This is becoming very frustrating, so I have tried to speed up the deployment. I deployed the site via maven with war:exploded. Now, I edit the files live in 'deployed' format. The problem being I will need to move these changes back to the source location for pushing into our source control.

So has anyone written a script to 'undeploy' changes on the server carefully pointing them back to where maven expects them to be, or found another way I can instantly see my changes in a web browser. Rebuilding from source everytime is not a fun solution.

A: 

Have you tried JavaRebel?

http://www.zeroturnaround.com/jrebel/

Alex Black
I will give that a look. I'd rather not get involved in additional licenses for something (IMHO) that should already exist for WAR development.
Drew
JRebel can be useful if your application takes time to restart (long initializations).
h3xStream
+1  A: 

Use hot-deployment. Just configure tomcat-maven-plugin and try tomcat:redeploy.

amra
+3  A: 

Currently, I have to make changes... tell maven to build them... then deploy to Tomcat. This is around 40seconds. So every change I make, I have to wait >=40seconds to see the change.

This is just a wrong way to use Maven in my opinion.

Either use something light like jetty:run (and hook Eclipse remote debugger to enable hotswap), see Configuring Jetty, Maven, and Eclipse together with Hot Swap.

Or use Eclipse WTP and deploy your project on a Tomcat server inside Eclipse (your project can be recognized as a Dynamic Web project whether you're using m2eclipse or the Maven Eclipse plugin).

Pascal Thivent
Eclipse WTP is the way to go for Tomcat dev. If you start the server in debug, modifications will be apply instantly. In normal mode, the application is restart (fews seconds).
h3xStream