Bug 346604

Summary: [build path] Removing a library confirmation dialog should offer to remove the library from the Java build path
Product: [Eclipse Project] JDT Reporter: Alessio Pollero <alessio.pollero>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: alessio.pollero, daniel_megert
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Alessio Pollero CLA 2011-05-20 04:28:58 EDT
Build Identifier: 20110301-1815

I've created a Project with a lib folder inside that contains external jar library that the project load, i usually add the necessary library in the lib folder of the project and then with a right click on it i select add to build path and everything work correctly.

Sometimes i need to remove a library from the project because became unused, hence  i remove the library by right click on it in the lib folder of the project and then click on delete; after this operation the library is removed from the project and from filesystem but is not removed from the project build path and an entry remain in the .classpath file, this cause an error on eclipse that say that a library isn't found on the project.

From my point of view when i remove the library from the lib folder eclipse should automatically remove every reference of it in the build path and .classpath file.

Reproducible: Always

Steps to Reproduce:
1.Add a library folder in the project
2.add jar library in the lib folder and then add this to the build path by right click on it
3.Remove the library by right click on it and then click delete
Comment 1 Dani Megert CLA 2011-05-20 05:02:25 EDT
> Steps to Reproduce:
> 1.Add a library folder in the project
With "library folder" you mean a normal folder that contains the JAR files, right?

> 3.Remove the library by right click on it and then click delete
You get a dialog saying that the JAR is referenced by a project, correct?


Note, that you can achieve what you want by deleting the actual JAR (object) in the Package Explorer instead of deleting the file.
Comment 2 Alessio Pollero CLA 2011-05-20 17:19:28 EDT
Yes. The folder is a normal folder created for containing jar file .

I get a Dialog saying : 

"Archive File 'xxx.jar' is referenced by the following project. Do you still want to delete it ?"

and i have the following options : 

Yes to All --- No --- No To All --- Cancel --- Yes 


I think that is reasonable adding an option that allow also to remove the reference in the project because can save time ... 

Without this option i need to remove the library in two step : 

1) Remove reference of the library in the Referenced Libraries section of the project 
2) Remove the library in the folder

This is not a bug but an optimization that can save time ...