Bug 562798 - auto import imports projects found in binary/target directories
Summary: auto import imports projects found in binary/target directories
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.16   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-04 17:11 EDT by Max Rydahl Andersen CLA
Modified: 2020-05-08 16:20 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Rydahl Andersen CLA 2020-05-04 17:11:41 EDT
Using open projects from file system on a project where inside the `target` directory of a maven project exists another project (i.e. https://github.com/quarkusio/quarkus has such when built) results in import of these temporary projects.

the auto detection should be smart enough to realize that the binary subfolders of maven, gradle, etc. projects are not something to import from - at least make it default option turned off.
Comment 1 Rolf Theunissen CLA 2020-05-05 07:11:19 EDT
The default project import wizard does not look at the project natures. It searches for directories that contain a '.project' file, and all nested directories when that is selected. Moreover, the project import wizard is not aware of the different natures that a project can have, the natures are specified in different projects.
The wizard cannot determine if a project is in a target directory or not.

It might be possible to support such a filtering, if the project import wizard defines extension points to allow some kind of filtering. Then the different projects that define the natures should provide nature dependent filtering.
Best changes of getting such a functionality would be probably by a feature request on the M2Eclipse, Buildship and/or JDT projects.

w.r.t. Maven projects, does the import 'Existing Maven Projects' wizard from the M2Eclipse project provide the functionality you are looking for?
Comment 2 Max Rydahl Andersen CLA 2020-05-05 08:08:16 EDT
the original idea for the auto importer was that the contributing detectors would once chosen to import a project would be the ones iterating what would make sense to descent into.

Looks like that never made it in :/

And existing maven projects import does seem to ignore target folders - but that does not help the auto import which you trigger when using `eclipse <folder>`
Comment 3 Rolf Theunissen CLA 2020-05-08 16:20:32 EDT
(In reply to Max Rydahl Andersen from comment #2)
> the original idea for the auto importer was that the contributing detectors
> would once chosen to import a project would be the ones iterating what would
> make sense to descent into.
> 
> Looks like that never made it in :/
> 
> And existing maven projects import does seem to ignore target folders - but
> that does not help the auto import which you trigger when using `eclipse
> <folder>`

Sorry, I mixed up the 'Import Existing Projects into Workspace' and 'Import Projects from File System or Archive'. The last one should indeed be more intelligent and be able to skip some projects.

[maven] https://git.eclipse.org/c/m2e/m2e-core.git/tree/org.eclipse.m2e.importer
[gradle] https://github.com/eclipse/buildship/issues/356