From b128c37af6c92166db6856f226be402defac3dc8 Mon Sep 17 00:00:00 2001
From: treilhes
Date: Wed, 28 Aug 2024 10:46:19 +0200
Subject: [PATCH] Changed maven classpath container check to maven nature one
---
.../org/eclipse/m2e/jdt/internal/UnitTestSupport.java | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/UnitTestSupport.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/UnitTestSupport.java
index 6051c2dc4..e57f9e737 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/UnitTestSupport.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/UnitTestSupport.java
@@ -38,7 +38,6 @@
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.launching.JavaRuntime;
import org.apache.maven.plugin.Mojo;
@@ -47,7 +46,6 @@
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.IMaven;
-import org.eclipse.m2e.core.internal.IMavenConstants;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider;
@@ -232,12 +230,7 @@ public void setupLaunchConfiguration(ILaunchConfiguration configuration) {
}
IProject project = JavaRuntime.getJavaProject(configuration).getProject();
- // maven project if project has a maven classpath
- boolean isMavenProject = configuration
- .getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, "")
- .equals(MavenRuntimeClasspathProvider.MAVEN_CLASSPATH_PROVIDER);
-
- if(project != null && project.hasNature(IMavenConstants.NATURE_ID) && isMavenProject) {
+ if(MavenPlugin.isMavenProject(project)) {
switch(configuration.getType().getIdentifier()) {
case MavenRuntimeClasspathProvider.JDT_TESTNG_TEST: