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.
Expected Result: - Saving a class should result in a build and deployment Actual Result: - JSP's are saved and deployed as expected - Classes are saved but not deployed Steps to recreate: - Create a new Maven Web Application - Run the webapp and select Tomcat 6 as the container to see the default Hello World! from index.jsp - Edit the JSP and Save - Refresh the Browser to see your changes - Add a new RESTful Web Service (e.g. a Simple Root Resource from Patterns, default values result in a "GenericResource" class with a getXml() method) - Edit the getXml() on GenericResource to return a string value (e.g. "Hello World!") - Run the webapp to execute a Maven build - Browse to your Web Service (/resources/generic by default) to see your string value - Edit the string return value of getXml() and Save - Expected result is to see you new string value, however nothing has changed
Is the problem that classes under /resources/generic when saved are not compiled and redeployed but classes under src/main/java are?
I've retested and no classes under src/main/java in this scenario are being deployed when saved.
If I remember well there are two options on project which has to be set on: "Compile on Save" and "Deploy on Save". Are both of these set to true? I do not have IDE in front of me but one option is somewhere in compilation panel and other in run panel in project properties.
In the Project Properties, under 'Build > Compile > Compile On Save', the option is in the form of a drop-down and was tested originally with the 'For test execution only' option selected (the default). I have retested and no deployment occurs with any of the options selected (including the 'Disabled' option, but that's to be expected!). In the Project Properties under 'Run > Deploy on Save', the option is a greyed-out check-box (but it is still ticked) when the previously mentioned 'Compile on Save' drop-down is in the default 'For test execution only' setting. The 'Deploy on Save' check-box becomes enabled when the 'Compile on Save' drop-down is set to 'For application execution only' or 'For both application and test execution' allowing you to tick/un-tick the check-box. I have retested by toggling the 'Deploy on Save' check-box on and off with these two 'Compile On Save' options set but there is still no automatic deployment on save unfortunately. The workaround is to Run the project (I normally use F6 for this) in order to compile and deploy to your local container (currently Tomcat 6 for me), though it's a little awkward when you're in mid-flow.
With 'Properties > Build > Compile > Compile On Save' to 'For both Application and test execution' and making sure 'Properties > Build > Compile > Deploy on Save' is both enabled and ticked. I then performed a Clean and Build followed by a Run. Classes are now compiling and deploying (so I'm happy). I've retested this with a fresh project and it seems that you must do a Clean and Build after setting the 'Compile On Save' and 'Deploy on Save' options appropriately. I'm not so sure if this is an actual issue now or whether it's just a case of I'm not expecting to need to change the project defaults and run a Clean and Build for this functionality. If it's not just me (paranoia alert!) and others are running into this scenario, perhaps setting the 'Compile On Save' option to 'For both Application and test execution' as the default option for a new Maven Web Application instead of 'For test execution only' would help? Assuming this doesn't create further complications of course.
OK, this make sense and should be fixed or user should be somehow warned. I think I bumped into it once myself. (In reply to comment #5) > [...] perhaps setting the 'Compile On Save' option to 'For both Application > and test execution' as the default option for a new Maven Web Application > instead of 'For test execution only' would help? This is good idea regardless of this problem - to set CoS and DoS by default to true.
Default values of CoS and DoS has been already set to true in issue 203066. If I'm getting this right, the only thing that needs to be done is show some warning that user needs to rebuild application when changing one of these values?
Changing priority to P4 and title to reflect current state
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss