This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
For a maven project, in case of "Compile on save" is enabled, and "Apply code changes after save" (Settings->Java->Java Debugger) doesn't have effect after the code is recompiled. As a result, hotswap is not being triggered. This is crucial for JRebel to work in debug mode so that the breakpoints could be re-initialized for the new lines of code (new methods added at runtime). For this to work, the user can push Debug->Apply Code Changes and then it triggers the compilation and update of the changed classes, however it is not very practical: users almost don't know about this feature & this is an extra step that ruins UX. In addition, for maven projects it is not possible to run compilation for the single class via F9. Not that this problems are not present for the non-maven projects. The ideal workflow could be: start the app in debugger mode, make a change (add a statement in a method body), press Ctrl+S to save (which triggers compilation of "Compile on Save" is enabled. Once the compilation is complete - Hotswap should be triggered in order to update the code. If "Apply code changes" would be supported for maven projects, the users will have much smoother debugging experience, and JRebel can leverage that as well.
I'll check what's wrong with apply code changes and Maven.
It looks like this concerns debugging of Maven WEB modules only. When I set a CoS mode on a Maven Java project, debugger is started via ANT and "Apply code changes" works as expected. In Maven WEB modules, CoS mode can be set for the application execution or for test execution or both. On WEB project debug, MavenDebuggerImpl.attachDebugger() is called in both CoS and non-CoS mode. But on test debug, Maven's JPDAStart is called when test execution is in non-CoS mode, but ANT's JPDAStart is called when test execution is in CoS mode. This fixes the automatic "Apply code changes" for Maven WEB modules with CoS mode for application execution: changeset: 246619:c0b983e93f8b http://hg.netbeans.org/core-main/rev/c0b983e93f8b And this fixes the automatic "Apply code changes" for debugging of Maven tests (in both Java and WEB projects), when CoS is set for the application execution only. In this case the application code is reloaded, but the test code is not. changeset: 246621:4b171db8d546 http://hg.netbeans.org/core-main/rev/4b171db8d546
Integrated into 'main-golden', will be available in build *201302162300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/c0b983e93f8b User: mentlicher@netbeans.org Log: #225852: Check if CoS is enabled and if yes, set listeningCP.
Verified with Dev build 201303032300. Works like a charm!
Transplanted to release73 branch: https://hg.netbeans.org/releases/rev/74023b4f3044 https://hg.netbeans.org/releases/rev/265a8b5381ab
Integrated into 'releases', will be available in build *201303141828* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/74023b4f3044 User: mentlicher@netbeans.org Log: #225852: Check if CoS is enabled and if yes, set listeningCP. (transplanted from c0b983e93f8b3a21a13f3aafa8210624d89028eb)
Product Version: NetBeans IDE 7.3 (Build 201303141828) Java: 1.7.0_15; Java HotSpot(TM) 64-Bit Server VM 23.7-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_15-b03 System: Linux version 3.0.0-12-generic running on amd64; UTF-8; cs_CZ (nb) User directory: /home/cesilko/.netbeans/7.3 Cache directory: /home/cesilko/.cache/netbeans/7.3 Verified in NetBeans 7.3.1 build. Code changes in *.java files are automatically applied in the aforementioned setup.