Skip to content

Commit 9e5e4d1

Browse files
committed
[Launching] Only set project-name if IProject is existing IJavaProject
Fixes #1293
1 parent f85e052 commit 9e5e4d1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

org.eclipse.m2e.launching/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %Bundle-Name
44
Bundle-SymbolicName: org.eclipse.m2e.launching;singleton:=true
5-
Bundle-Version: 2.0.300.qualifier
5+
Bundle-Version: 2.0.400.qualifier
66
Bundle-Localization: plugin
77
Require-Bundle: org.eclipse.core.runtime,
88
org.eclipse.core.variables,

org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import org.eclipse.debug.core.ILaunch;
4545
import org.eclipse.debug.core.ILaunchConfiguration;
4646
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
47+
import org.eclipse.jdt.core.JavaCore;
4748
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
4849
import org.eclipse.jdt.launching.IVMInstall;
4950
import org.eclipse.jdt.launching.IVMInstall2;
@@ -228,7 +229,8 @@ public IVMInstall getVMInstall(ILaunchConfiguration configuration) throws CoreEx
228229
}
229230
}
230231
}
231-
Optional<IProject> project = getContainer(pomDirectory).map(IContainer::getProject);
232+
Optional<IProject> project = getContainer(pomDirectory).map(IContainer::getProject)
233+
.filter(p -> JavaCore.create(p).exists());
232234
if(project.isPresent()) {
233235
// Set the project name so that super.getVMInstall() called below, can find the JDT-Compiler JDK
234236
ILaunchConfigurationWorkingCopy workingCopy = configuration.getWorkingCopy();

0 commit comments

Comments
 (0)