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.
Tried to take advantage of the [Compile On Save] option in project properties dialog. In an ant based project, it allows me to update a java source, and instantly see the updated application re-deployed on my GlassFish V2.1 instance. I have set the option to [For both application and test execution] but still do not see the updates re-deployed. I need to re-run the application to get the updates re-deployed, which is annoying for incremental development as well as for demonstration purposes. Will attach ant and maven based test applications, where after running them, you should see "hi there" string displayed with browser at both: http://localhost:8080/HelloWorld/helloworld (ant) http://localhost:8080/helloworld-webapp/helloworld (maven) you can then try to change the String value returned from the HelloWorldResource.getClichedMessage() method from "hi there" to e.g. "hello there" at line 14. the content will get updated (after page refresh in the browser) only for the ant based web application
Created attachment 82035 [details] maven based helloworld web app
Created attachment 82036 [details] ant based helloworld web app
tried on NetBeans 6.7 daily build tagged as 20090512001, solaris_x86 nevada
it seems the class gets compiled after change, but doesn't end up in the expanded web application. When checking ant based project, I've noticed these compile directly into the expanded webapp space, while maven projects comile to target/classes and only afterwards assemble the expanded web app in the next build steps. The automated java Compile on Save infrastructure then saves the class files outside of the expanded webapp.
thanks to greaqt help by phejl we've managed to add code that copies the class files from target/classes to the expanded web application http://hg.netbeans.org/main/rev/0f0ac1d94478
Integrated into 'main-golden', will be available in build *200905160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/0f0ac1d94478 User: Milos Kleint <mkleint@netbeans.org> Log: #165045 deploy on save in maven projects needs to copy class files from target/classes into the expanded webapplication
Verified at the nightly build from 090518, where it works fine with GFv2 Thank you a lot for the fast response and fix. Great job!
One more (and hopefully the last one) thing missing at this feature is auto-adding any newly created classed to the auto-redeployed web application. This works perfectly for the ant based scenario. How to reproduce: add a new class called "Gaga": --cuthere-- import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Gaga { public String gaga="gaga"; } --cuthere-- then change the existing class HelloWorldResource to: --cuthere-- import javax.ws.rs.GET; import javax.ws.rs.Produces; import javax.ws.rs.Path; @Path("/helloworld") public class HelloWorldResource { @GET @Produces("application/xml") public Gaga getClichedMessage() { return new Gaga(); } } --cuthere-- then you should see an xml displayed at the browser (http://localhost:8080/HelloWorld/helloworld for the ant based app) for the maven based test case, you will end up with no class def found exception (nb just crashed, when i wanted to copy&paste the exact message text)
http://hg.netbeans.org/main/rev/c5788b72273c issue with FileObject conversion. FileObjects don't exist for missing files.
Integrated into 'main-golden', will be available in build *200905200201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/c5788b72273c User: Milos Kleint <mkleint@netbeans.org> Log: #165045 when destination file doesn't exist (conversion to FileObject fails), we create it.
v.