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 web module code is trying to keep the build folder in sync with the web sources by updating the files in build whenever the user saves, renames, deletes, etc. the files in web sources (see #46446). This is potentially inconsistent with the way the Ant build builds the web module. We are using Ant for building and the semantics of build can be changed by various tasks overridden by the user. The easiest way to break this is to just define a filter in Packaging Project tab of project properties - this will be ignored by the java code that does automatic updates in build/*. Even if we make the java code clever to cover couple cases like that we will never get it work right 100%. What if I have a -post-compile task that changes all files after copying them. So, mixing Ant with some clever java code is dangerous and takes all the nice flexibility out. And it can never be fixed since the semantics of ant is unknown (bcs it can be overriden by user). I found the following solution for doing the rename/delete/move synchronization but it is implemented in build script so it does not get done automatically on save. It requires the user to build or run the project. Perhaps we could run this ant task on Save asynchronously using an unobtrusive progress bar or something... The solution is Ant's sync task introduced in 1.6. It synchronizes two directories doing all the rename/delete/copy stuff. I am playing with it and it seems to do what we want. The only problem is that it interferes with the way we currently create WEB-INF/classes under build/web folder. The sync task naturally deletes this because it is not in 'web' folder in source. This is not acceptable, we need to preserve WEB-INF/classes folder if nothing has changed - first to avoid having to compile classes and second to avoid unnecessary deployment steps (the j2eeserver uses timestamps to figure out what needs to be done). I found a solution for this in defining a separate folder into which the java classes are first compiled and then copying them into build/web/WEB-INF/classe. The content of build directory would then look like: build +-java +-WEB-INF +-classes +-mypackage +-Servlet.class +-web +-META-INF +-context.xml +-WEB-INF +-web.xml +-classes +-mypackage +-Servlet.class +-index.jsp This way I let the sync task copy both the projectHome/web and projectHome/build/java and it works. The structure under java folder has to follow the placement under build/web. The only disadvantage is the extra copying of java classes. I think this is worth the improvement.
not targeted for 4.0
Also see issue #45273 Remove library - doesn't clean project.
no user ever complained about this, changing to an enhancement, P4
I run in this issue today in our standard web-projekt ( 5.0 ). I defined a filter in the build.xml file which replaces some tokens ( urls in jsp and html files ). But every time I save a html/jsp-file It gets copied with no tokens replaced into the build folder ( which is the web-root for our external tomact ). My workaround was to add overwrite="true" to the copy-task in the -copy-webdir target so everytime I build the projekt all files are copied ( and the tokens replaced ). I would appreciate the possibility to turn the CopyOnSaveSupport functionality off in a web-projekt.
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