Hot swap with Netbeans 7.1 and Glassfish 3.1.1

2020-03-27 12:24发布

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.

1条回答
女痞
2楼-- · 2020-03-27 12:54

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.

The Run page of a maven based web app project's properties in NetBeans 7.1

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.

查看更多
登录 后发表回答