Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New setting entry to let user choose project type #600

Closed
akaroml opened this issue Jul 30, 2018 · 3 comments · Fixed by #2037
Closed

New setting entry to let user choose project type #600

akaroml opened this issue Jul 30, 2018 · 3 comments · Fixed by #2037

Comments

@akaroml
Copy link
Contributor

akaroml commented Jul 30, 2018

We have projects that have multiple project info inside. Like this one:
https://github.com/spring-guides/gs-spring-boot

Both Gradle and Maven project info exists. In this case, Gradle wins by default.

The project configurations come from the source repo, but when users actually work on it, it's better to have an option to let users choose their preferred project type.

The new setting could look like:
preferredProjectType: "Gradle" // or "Maven"

And the setting could be global or per project.

@fbricon
Copy link
Collaborator

fbricon commented Jul 30, 2018

You can use java.import.gradle.enabled:false or java.import.maven.enabled:false, for similar results

@Eskibear
Copy link
Contributor

Eskibear commented Sep 3, 2018

@fbricon I tried the both settings, they work in most cases. For some reason I have such a repository, in the Utils folder, there are Maven based utils, and the main project is Gradle based. I want to import all Maven and Gradle projects, but only Gradle projects are recognized.

@Eskibear
Copy link
Contributor

Eskibear commented Sep 3, 2018

I think the root cause is Here, When gradle importer applies, it stops checking for other importers. So whenever there is a build.gradle file in the workspace, there would be no maven projects recognized I think.

	private IProjectImporter getImporter(File rootFolder, IProgressMonitor monitor) throws OperationCanceledException, CoreException {
		Collection<IProjectImporter> importers = importers();
		SubMonitor subMonitor = SubMonitor.convert(monitor, importers.size());
		for (IProjectImporter importer : importers) {
			importer.initialize(rootFolder);
			if (importer.applies(subMonitor.split(1))) {
				return importer;
			}
		}
		return null;
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants