Community
Participate
Working Groups
Build Identifier: I20100520-1744 If web project is constructed of links to external or internal resources, builder 'org.eclipse.wst.jsdt.core.javascriptValidator' erroneously removes just modified web.xml. Reproducible: Always Steps to Reproduce: 1. Create a Dynamic Web Project 'Test' in Eclipse workspace 2. Make sure that the project has JavaScript facet. 3. Add folder WEB-INF to 'Test' (path /Test/WEB-INF) linked to /Test/WebContent/WEB-INF so that it conveniently displays content of WEB-INF one level higher. 4. Open web.xml in text or xml editor; modify it and save. 5. web.xml suddenly disappears; both from workspace and on disk. Item 3 is crucial, without such a linked folder I have not got a use case that breaks projects.
On comparing files .classpath and .jsdtscope I found that There is entry in .classpath: <classpathentry kind="output" path="build/classes"/> and entry in .jsdtscope: <classpathentry kind="output" path=""/> That explains that resource is removed with path relative to project (which is considered as the output path) same as the path relative to WebContent. After I had manually set output path to "build/classes" in .jsdtscope, everything worked well. But I found no way to change that property other than manually. And why it was not equal to Java output in the beginning, since New Dynamic Web Project wizard suggested no way to select it separately, and actually I had no idea of its existence until it had appeared in such a peculiar way.
Sounds like it might be a duplicate of bug 335247.
That issue and others referenced in it are similar to this one. And fix applied there that stops removing files from output will help for this issue. But the question remains: why jsdt sets project itself to be its output instead of Java output when new Dynamic Web Project is created?
"output" in this sense is just an artifact of JSDT being a fork from JDT. It has no really use, but it's there because our APIs still have references to it.
As soon as "output" is not used and JSDT does not modify its content when performing build, the issue is fixed.
*** This bug has been marked as a duplicate of bug 335247 ***