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.
Summary When the contents of the distribution directory are being deleted the IDE follows any symbolic links it finds and deletes the contents of the directories at the end of the link. These directories are not IDE built and should not be touched. In more detail I have a symbolic link called "P:" in my distribution directory. It is a link to the data for the application. Whenever the IDE deletes the content of the distribution directory (usually during rebuilding or refactoring) the delete operation finds my P: symbolic link, follows it to the data directory, and deletes the contents i.e. it deletes all the data for the application. Not good ! (Why do I have a symbolic link in my distribution directory ? I want my application to work in a convenient distributed manner on Windows and Unix/Mac. All data for the application is on a network drive (Windows) or shared drive (Unix/Mac). To satisfy both I call the root of my data "P:". On Windows this is a drive letter and therefore absolute. On Unix it is a relative name so the code will look for P: in the distribution directory so I place there a link to the shared drive. Yes, there are many ways around this but in the end the IDE shouldn't follow the link I think.)
Looks like a data loss case => P1, even though corner case. For me it looks like the issue of nbproject/build-impl.xml ("-do-clean" target, probably) been generated for the project. ianb, what is the type of your project? Java Application? or something else?
The problem was on Java application projects.
P2 as the dist folder should not contain the user data, it's a build folder. The problem is related to the Ant issue https://issues.apache.org/bugzilla/show_bug.cgi?id=1550. I am going to change the usage of <delete> task to use fileset with followsymlinks='false' as described in the issue.
The <delete> task with followsymlinks='false' seems to work fine. Everything else except the symlink is deleted. The dist folder cannot be deleted as it's not empty => after clean the dist folder is not removed and it cotains just the sym link (P: in your case).
The same behavior can be now achieved even without filesets using <delete dir="${dist.dir}" followsymlinks="false"/> but the problem is that if followsymlinks == false the top level folder is not deleted for some reason.
Fixed 928e51ce13df Not yet integrated as the repository is closed.
Fix seems to be ok
Tomasi, can you please integrate the fix. thanks
Already done. T.
Integrated into 'main-golden', will be available in build *200911241400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/928e51ce13df User: Tomas Zezula <tzezula@netbeans.org> Log: #176851:Distribution directory delete follows symbolic links and deletes there too
verified, if I'm right the fix is in 6.9 -> correcting TM
The fix seems OK to me.
Integrated into 68