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.
The Maven "Compile-on-save"/Copy-on-save support no longer works. Basic steps to verify: * Create a simple maven project web application that has some classes in src/main/java and some resources in src/main/resources. * Change the "Compile on Save" setting in NetBeans to "on application and test execution". * Change a java class in src/main/java/my/package/name/Foo.java or a resource in src/main/resources/my/package/name/Foo.properties. The expected result is that an updated .class file would show up in target/{web_app_name}/WEB-INF/classes/my/package/name/Foo.class or target/{web_app_name}/WEB-INF/classes/my/package/name/Foo.properties would be updated. In 7.1, the class/property file are updated in the target directory tree. In 7.2 RC1, they aren't. This is a BIG deal and a major productivity killer for 7.2
I can confirm it is reproducible in NetBeans 7.2 RC1 as described. Deploy on save works as expected.
The class file update works ok. Please specify complete steps to reproduce. I'm missing build or run step. Without that it never worked even in 7.1. I can just confirm property file is consistently failing to be updated.
I tested following: 1) create maven web project targeting GF 2) create servlet 3) invoke build 4) change sevlet In 7.1 class file in target/classes was properly updated and in target/{web_app_name}/WEB-INF/classes was not updated. In 7.2 class file in target/classes was properly updated and in target/{web_app_name}/WEB-INF/classes was not updated. So there is no change. I'll check the property files.
(In reply to comment #3) > I'll check the property files. The same scenario with property file: In 7.1 property file in target/classes was properly updated and in target/{web_app_name}/WEB-INF/classes was updated as well. In 7.2 property file in target/classes was not properly updated and in target/{web_app_name}/WEB-INF/classes was not updated as well. This regression on property file seems to be caused by: http://hg.netbeans.org/web-main/rev/079cf785d749
(In reply to comment #4) > (In reply to comment #3) > > I'll check the property files. > > The same scenario with property file: > In 7.1 property file in target/classes was properly updated and in > target/{web_app_name}/WEB-INF/classes was updated as well. > > In 7.2 property file in target/classes was not properly updated and in > target/{web_app_name}/WEB-INF/classes was not updated as well. > > This regression on property file seems to be caused by: > http://hg.netbeans.org/web-main/rev/079cf785d749 Correction: property file is broken on every even Build in 7.2.
Created attachment 121700 [details] sample app Sample Tapestry 5 application illustrating the issue
I created the following simple project by running the Tapestry 5 Getting Started guide (http://tapestry.apache.org/getting-started.html) , e.g: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org and selecting the org.apache.tapestry:quickstart, version 5.3.3 I opened the project in NetBeans 7.1. I went to the project properties and selected COS for application and test execution. For a good measure, I ran the build from the IDE. Then, on the command line, I ran "mvn jetty:run" and navigated to http://localhost:8080/nb_cos (to see if my changes are being picked up by jetty). 1. I changed the src\main\resources\org\nb\nb_cos\pages\Index.tml and src\main\resources\org\nb\nb_cos\pages\Index.properties and src\main\java\org\nb\nb_cos\pages\Index.java . In 7.1, I saw all three files (.tml, .properties and the .class) get immediately updated in both classes directories (target\classes\org\nb\nb_cos\pages and target\nb_cos\WEB-INF\classes\org\nb\nb_cos\pages) In 7.2, changing the .tml, and .properties file doesn't propagate the changes to the classes directories. The change to .java does propagate to the classes directories.
Fixed in web-main de42943d36ef. Milosi, please review the fix one other change I had to made is to add _recursive_ listener. akochnev thanks for the detail description! Jirko can you please verify? Martine, this was not actually caused by your change as I stated in comment #4. Sorry for that.
(In reply to comment #8) > Fixed in web-main de42943d36ef. > > Milosi, please review the fix one other change I had to made is to add > _recursive_ listener. Looks good to me.
(In reply to comment #8) > Martine, this was not actually caused by your change as I stated in comment #4. So which change caused this "regression"? If this used to work in 7.1 we had to change something in 7.2, right? I'm just curious what it was.
(In reply to comment #10) > (In reply to comment #8) > > Martine, this was not actually caused by your change as I stated in comment #4. > > So which change caused this "regression"? If this used to work in 7.1 we had to > change something in 7.2, right? I'm just curious what it was. 2dd85d25f17b fc6088a2c096
Integrated into 'main-golden', will be available in build *201207040002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/de42943d36ef User: Petr Hejl <phejl@netbeans.org> Log: #215089 Maven COS no longer works
It doesn't work for me in dev build 201207040002. It might be caused by bug 214182. I did the following: - create maven web project with GlassFish server - create servlet - create html - create properties in resources - build project - facing bug 214182 - exceptions are thrown repeatedly (http://statistics.netbeans.org/exceptions/exception.do?id=597704) - change and save servlet => class neither updated in target/classes nor in WEB-INF/classes; sometimes it is cleaned from target/classes after save - change and save properties => properly updated in both locations - change and save html => properly updated in both locations
(In reply to comment #13) > It doesn't work for me in dev build 201207040002. It might be caused by bug > 214182. I did the following: > > - create maven web project with GlassFish server > - create servlet > - create html > - create properties in resources > - build project > - facing bug 214182 - exceptions are thrown repeatedly > (http://statistics.netbeans.org/exceptions/exception.do?id=597704) not facing this on macosx and most likely unrelated, cannot see how the change by phejl could have broken this. > - change and save servlet => class neither updated in target/classes nor in > WEB-INF/classes; sometimes it is cleaned from target/classes after save I see something different here. The 2 significant locations are target/classes and target/mavenproject1-1.0-SNAPSHOT/WEB-INF/classes. I see the class being updated in the first location (that's where the java support copies it) but the classes are not appearing in the expanded web app folder, that copying is done someplace in the websupport? > - change and save properties => properly updated in both locations > - change and save html => properly updated in both locations +1 both locations are updating for me. That's what has been fixed by the patch by phejl AFAIK.
From what I can see, the basic
Fixed project closing web-main 854f509aa955.
(In reply to comment #14) > (In reply to comment #13) > I see something different here. The 2 significant locations are target/classes > and target/mavenproject1-1.0-SNAPSHOT/WEB-INF/classes. I see the class being > updated in the first location (that's where the java support copies it) but the > classes are not appearing in the expanded web app folder, that copying is done > someplace in the websupport? > See my comment #3 it does not work even in 7.1 and I think it is this way from the very beginning: In 7.1 class file in target/classes was properly updated and in target/{web_app_name}/WEB-INF/classes was not updated. So we definitely don't want to fix this part in HR if we want to fix it at all. Though the usecase reported in comment #7 now perfectly works for me (even the class file). I guess embedded jetty is looking for fresh classes in target/classes.
akochnev, can you verify with your use case?
(In reply to comment #15) > From what I can see, the basic Milosi is something missing here? Any details?
(In reply to comment #19) > (In reply to comment #15) > > From what I can see, the basic > Milosi is something missing here? Any details? written in error, no idea what I meant or what it happened.
(In reply to comment #20) > (In reply to comment #19) > > (In reply to comment #15) > > > From what I can see, the basic > > Milosi is something missing here? Any details? > > written in error, no idea what I meant or what it happened. Ok. The issue #214182 seems to be completely unrelated to this one or to the recent changes. Any idea how this could happen. Jirko, can you work around it and verify this one?
I've just tested on Linux and Windows and works ok for me. I'll try with windows and long username ;)
If bug 214182 doesn't appear, it works in dev build 201207040002. Tested: - create maven web project with GlassFish server - create servlet - create html - create properties in resources - build project - change and save servlet => class updated in target/classes => class not updated in WEB-INF/classes - change and save properties => properly updated in both locations - change and save html => properly updated in both locations
I tested with -J-da and everything works. Do we agree that this issue is fixed?
Yes, it is fixed.
I downloaded Confirmed that the changes to the resources are being propagated to both target\classes and target\${web_app_name}\WEB-INF\classes. Changes to java classes do propagate to the class files in target\classes but not to the classes in target\${web_app_name}\WEB-INF\classes. I understand that the discrepancy (e.g. resources showing up in both places, class files only in one) is expected behavior (as discussed in the ticket) ; however, is this how it really should be (maybe I should file another ticket for post-7.2?) ? Also, I noticed that when I initially opened the project, the COS behavior didn't start until I ran a maven build from the IDE. What is the trigger for COS to start working ?
(In reply to comment #26) > Also, I noticed that when I initially opened the project, the COS behavior > didn't start until I ran a maven build from the IDE. What is the trigger for > COS to start working ? for classes it's presence of .netbeans_automatic_build file in target/classes. Which is checked and set after each build (clean could have deleted it, so we need to reinsert it). It's more or less by design, the assumption is that you always have to start some "Run" related action in order for the CoS to make sense.
Integrated into 'main-golden', will be available in build *201207060002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/854f509aa955 User: Petr Hejl <phejl@netbeans.org> Log: #215089 Maven COS no longer works
Pushed to release72 as b75de5440c30 and 8e97882eeaf0.
Integrated into 'releases', will be available in build *201207092359* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/b75de5440c30 User: Petr Hejl <phejl@netbeans.org> Log: #215089 Maven COS no longer works
Verified in NetBeans IDE 7.2 (Build 201207092359).