Bug 550228 - Deleting multiple interdependent projects triggers builds which prevent deletion
Summary: Deleting multiple interdependent projects triggers builds which prevent deletion
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.20   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-19 15:19 EDT by Christopher Tubbs CLA
Modified: 2023-08-01 20:01 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Tubbs CLA 2019-08-19 15:19:22 EDT
I see this issue very commonly when building multi-module m2e builds. However, I would expect the issue to occur in any workspace with multiple projects open which depend on one another, so it is not specific to m2e.

If I have, for example, 20 projects open, some of which depend on the others, and I select all 20 projects and delete them from the workspace, the deletion of some of them causes the ones that depend on them to rebuild, even though they are also scheduled for deletion. These projects fail to rebuild (because their dependency has been removed), and then are left in the workspace, instead of being deleted.

When this occurs in a multi-module m2e build, this causes additional errors, such as creation of bin/ directories and edits to .gitignore files, because the maven project is confused.

The workaround is to close all 20 projects first, and then delete them, so that rebuilds are not triggered.

It should be much easier to delete projects from the workspace. A good fix for this would be to *not* allow rebuilds to be triggered for a project if the UI is currently in the process of deleting it from the workspace.

This issue has existed for as long as I've been using Eclipse (nearly 10 years), and I'm finally getting annoyed with it enough to report it as a bug. :)
Comment 1 Christopher Tubbs CLA 2019-08-19 15:22:42 EDT
Instead of trying to track which projects are "scheduled for deletion" from the UI, it might be easier for the "delete project" action in the menu to execute a "close project" on all selected projects, before executing the "delete project" action which was requested.
Comment 2 Eclipse Genie CLA 2021-08-09 13:10:54 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 3 Christopher Tubbs CLA 2021-08-09 13:48:09 EDT
The bug is still relevant. Deleting projects should not trigger rebuilds on projects also being deleted. Yet, this still happens with the latest version.
Comment 4 Eclipse Genie CLA 2023-07-31 02:28:50 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Christopher Tubbs CLA 2023-08-01 20:01:01 EDT
This is still definitely an issue. The fix for this should be simple. It should just be changing the logic from something like:

    selectedProjects.deleteAll()

to:

    // close them all before trying to delete them, since closing several at once does not appear to trigger rebuilds like deleting does
    try {
      selectedProjects.closeAll();
    } finally {
      selectedProjects.deleteAll();
    }

I made an attempt to figure out where I could make the change myself, to submit a patch for consideration, but it was not intuitive, as I'm not familiar with the code at all.