So our new webapp project is based on maven. I'm really liking the dependency management and IDE agnostic approach but I'm having problems with compilation and debugging.

Here's how I would currently get a clean copy of the project working

  1. Check out the main project from SVN
  2. Open the project in IDE (I've tried in eclipse 3.4 and netbeans 6.7)
  3. The IDE will automatically open two subprojects one being the webapp, the other being a supporting utils jar.
  4. From the command line I run mvn war:inplace on the webapp module which builds a working copy of the webapp with all dependencies in WEB-INF/lib/

This then runs fine but whenever I change a java class I have to clean and build / reload the app context.

I've googled high and low but no one seems to be complaining about this so I guess there must be something really obvious I'm missing. How is everyone else handling incremental compilation and hot deploy with maven?

To clarify all I'm looking for is the replicate the behavior I used to have before maven where I could make simple changes to java classes and they would be instantaneously compiled and hot deployed to a running webapp. I don't need anything fancy like jRebel etc I just want the new tool to give me the same functionality I enjoyed with my old tools.

+1  A: 

If you can use mvn jetty:run it will read the classes and resources directly from the project. Using Maven2 Eclipse plugin and running the server embedded in Eclipse has auto-publishing, which gets you there in the end, although it's slower. And JRebel starting with 2.0 (as you may know) can map the Maven module directly to the deployed application, so you get instant build and redeploy. Those are the only solutions I know of.

Jevgeni Kabanov

Netbeans should support it out of the box. Though, there remains a bug related to this: