2

After my unsuccessful attempt to run Tomcat with hot deployment from NetBeans with Maven, I've tried jetty. The jetty-maven-plugin doc gave me an important hint:

The plugin will automatically ensure the classes are rebuilt and up-to-date before deployment. If you change the source of a class and your IDE automatically compiles it in the background, the plug-in will pick up the changed class.

If I look at $myproject/target/classes/... in the projects directory, I can see that NetBeans doesn't compile and refresh the class file on saving. I need to build the project explicitly to update the file and than jetty picks up the change. (The plug-in param "scanIntervalSeconds" is set to 1.)

How can I tell NetBeans to compile on save and update the class file so that jetty can pick up the change?

Provisional solution: "Project Properties > Build > Compile > Compile On Save: For both application and test execution". NetBeans warns me that the result is not the same as with a usal compiler run but it works so far.

Community
  • 1
  • 1
deamon
  • 89,107
  • 111
  • 320
  • 448
  • I know this doesn't answer the question but what is not satisfying with the "deploy on save" option of the GlassFish plugin? – Pascal Thivent May 06 '10 at 21:12
  • I've set "Project Properties > Build > Compile > Compile On Save: For both application and test execution" but cannot see changes in the browser after saving when using GlassFish. – deamon May 07 '10 at 06:15
  • @deamon. Your solution works for me (with scanIntervalSeconds set in my pom.xml). I recommend you answer your own question and mark it correct. – nasty pasty Feb 25 '12 at 06:57

1 Answers1

0

Project Properties > Build > Compile > Compile On Save: For both application and test execution". NetBeans warns me that the result is not the same as with a usal compiler run but it works so far.

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265