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

PDE-Projects with Tycho are loosing ExecutionEnvironment in .classpath #1810

Open
Zohhak opened this issue Aug 23, 2024 · 0 comments
Open

PDE-Projects with Tycho are loosing ExecutionEnvironment in .classpath #1810

Zohhak opened this issue Aug 23, 2024 · 0 comments

Comments

@Zohhak
Copy link

Zohhak commented Aug 23, 2024

Hi everyone,

somehow projects are loosing their set ExecutionEnvironment in the classpath file.
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
turns into
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">

This happens when i trigger Maven -> Update Project... (Eclipse context menu on project) or "Import as Maven Project" when i check it out from git.

This can be reproduced with the Tycho demo bundle tycho.demo.itp01. Just checkout the git and import the project in eclipse. (Import -> Existing Maven Porjects). With the Manifest file you can reset the ExecutionEnvironment to the expected value and then trigger a Maven Update Project.

I tried to debug it a little. In the TychoLifecycleMapping.addJavaProjectOptions function the classpath is added with the correct information, but the option-map is not filled. The calling function in AbstractJavaProjectConfigurator.configure then continues, tries to resolve an ExecutionEnvironment, that it can not find due to the empty map and then adds the default JRE_CONTAINER entry without ExecutionEnvironment.

So my question would be if the TychoLifecycleMapping.addJavaProjectOptions function can continue to call its super function even if it sets the classpath on their own already, move it out of the else block here:

protected void addJavaProjectOptions(Map<String, String> options, ProjectConfigurationRequest request,
		IProgressMonitor monitor) throws CoreException {
	IProject project = request.mavenProjectFacade().getProject();
	IPluginModelBase model = PluginRegistry.findModel(project);
	if (model != null) {
		ClasspathComputer.setClasspath(project, model);
	} else {
		super.addJavaProjectOptions(options, request, monitor);
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant