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.

Bug 193772 - Project clean fails on delete file
Summary: Project clean fails on delete file
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-23 13:07 UTC by pavelvesely
Modified: 2011-01-09 22:46 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample project (27.94 KB, application/x-zip-compressed)
2010-12-23 13:08 UTC, pavelvesely
Details
maven output (13.22 KB, text/plain)
2010-12-23 13:08 UTC, pavelvesely
Details
same project step later, error reemerges (40.12 KB, application/x-zip-compressed)
2010-12-24 09:12 UTC, pavelvesely
Details
maven output (13.35 KB, text/plain)
2010-12-24 09:12 UTC, pavelvesely
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pavelvesely 2010-12-23 13:07:03 UTC
Project clean fails when run from Netbeans:

Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project drill: Failed to clean project: Failed to delete C:\workspace\drill\target\endorsed\javaee-endorsed-api-6.0.jar

Running mvn clean outside Netbeans works without problems.
Comment 1 pavelvesely 2010-12-23 13:08:08 UTC
Created attachment 104450 [details]
sample project
Comment 2 pavelvesely 2010-12-23 13:08:37 UTC
Created attachment 104451 [details]
maven output
Comment 3 pavelvesely 2010-12-24 09:12:00 UTC
Created attachment 104472 [details]
same project step later, error reemerges
Comment 4 pavelvesely 2010-12-24 09:12:30 UTC
Created attachment 104473 [details]
maven output
Comment 5 Jesse Glick 2011-01-07 22:33:23 UTC
Something is holding open the JAR, and Windows has mandatory file locks. (And unlike Unix, you cannot hold open a file descriptor after unlinking the inode.) I doubt there is anything to be done about it, unless you are able to track down what exactly is holding the JAR open. (Assuming it is the NB process itself, heap analysis tools can show you all instances of java.util.zip.ZipFile and what the GC root references are.)

In this case, target/endorsed/*.jar is a workaround for http://jira.codehaus.org/browse/MNG-4752 (lack of direct support for endorsed scope).

(In reply to comment #0)
> Running mvn clean outside NetBeans works without problems.

NB 7.0 always forks the mvn executable so it should not make a difference, but timing may matter since file locks may be released after a GC.
Comment 6 David Konecny 2011-01-09 22:46:50 UTC
Was your project deployed to running server when you cleaned it? If yes then you may be experiencing issue 192895.