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 198497

Summary: removal of sharable library does not remove library jars
Product: projects Reporter: David Konecny <dkonecny>
Component: Ant ProjectAssignee: Milos Kleint <mkleint>
Status: RESOLVED WONTFIX    
Severity: normal CC: jglick
Priority: P3    
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description David Konecny 2011-05-10 23:34:50 UTC
project.ant.ProjectLibraryProvider.remove(ProjectLibraryImplementation) does not physically remove library jars - only properties from nblibraries.properties are removed.

I bumped into this problem while fixing issue 198056: I need to update a sharable library and so I remove it first and then copy it from global Library Manager. The side effect of this issue is that old jars end up sitting in filesystem next to new jars.
Comment 1 Jesse Glick 2011-05-10 23:47:05 UTC
The remove method is only intended to delete the definition of the library. Removing artifacts formerly referenced by the library is a separate task.
Comment 2 David Konecny 2011-05-11 00:05:20 UTC
(In reply to comment #1)
> Removing artifacts formerly referenced by the library is a separate task.

Whose task is it then? I'm calling LibraryManager.removeLibrary(Library) which for sharable libraries delegates deletion task to ArealLibraryProvider.remove(). Who else than implementation of ArealLibraryProvider can do it?
Comment 3 Jesse Glick 2011-05-11 01:11:01 UTC
Up to the project type, I guess; what code copied the JARs to this dir in the first place? You probably know better than me.
Comment 4 David Konecny 2011-05-11 01:27:34 UTC
I see what you mean. I will have a look and update bug description if necessary.
Comment 5 Milos Kleint 2013-03-08 15:53:37 UTC
performing clean up is a tricky thing, I'd rather leave it up to the user to eventually manage his jars.

We cannot keep track of which projects are using a given library and what libraries are using a given jar. so it's safer to keep everything in place to avoid breaking stuff.

 please reopen if you disagree.