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.
Adding (probably any) framework to existing web module removes the actual content of web.xml. Note: this is not related to issue 177370. I've tested the code before the fix, and after. It's the same. Problem is IMHO, in calling WebProjectProperties:save() method shouldCreateWebXml() is called from there, which returns true, regardles web.xml exists or not. Then web.xml is created all the time. See : DDHelper.createWebXml(j2eeProfile, webInf); is called from WebProjectProperties:save() method. There should be a test somewhere checking if web.xml exists or not. Qualifying as P1 as user data are completely lost.
fixed in 18a607365480 web.xml is created now only if it does not exist; I also added a check to DDHelper.createWebXml which throws IllegalStateException if web.xml should be overwritten to prevent similar issues in future and catch them earlier.
The fix seems to be fine. Just small comment: the check of webInf for null isn't needed. The project.getAPIWebModule().getDeploymentDescriptor() should return null in that case: Profile j2eeProfile = project.getAPIWebModule().getJ2eeProfile(); FileObject webInf = project.getAPIWebModule().getWebInf(); - if (shouldCreateWebXml() && webInf != null) { + FileObject ddFo = project.getAPIWebModule().getDeploymentDescriptor(); + if (ddFo == null && shouldCreateWebXml() && webInf != null) { DDHelper.createWebXml(j2eeProfile, webInf); } Can you please push it to release68 repository after QA engineer approval ?
Verified at the web-main, please integrate into release68.
transplanted to release68 as 2a55556e346f
Integrated into 'main-golden', will be available in build *200911261400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/18a607365480 User: David Konecny <dkonecny@netbeans.org> Log: Bug #177582 - Add Framework action removes the content od web.xml
Verified at the release68.