I usually start the AS in debug mode so that I can use hot swap. But how can I get that if whenever I change a configuration or java file Netbeans sends it to Glassfish and automatically redeploys my application?
Some details:
1 - Maven war application.
2 - Compile on Save: for both application and test execution.
3 - Java Debugger: Apply code changes after save.
To use the hot-swap capabilities of JPDA in a NetBeans/GlassFish environment, you need to turn off the 'Deploy on save' feature of NetBeans.
This feature can be configured on a per project basis, so it appears in the project's Properties dialog. The UI folks felt that deployment was more a part of running the project than compiling the project. The control that turns the feature on and off is in the 'Run' properties.
You may also notice that the project is running in Debug mode and the apply code changed tool is enabled. It is the icon directly under the string 'IDE' at the top of the screenshot.
来源:https://stackoverflow.com/questions/8927448/hot-swap-with-netbeans-7-1-and-glassfish-3-1-1