diff --git a/tycho-apitools-plugin/pom.xml b/tycho-apitools-plugin/pom.xml index 639ae06233..bc9f5196c8 100644 --- a/tycho-apitools-plugin/pom.xml +++ b/tycho-apitools-plugin/pom.xml @@ -69,6 +69,11 @@ org.eclipse.jdt.core 3.35.0 + + org.eclipse.jdt + org.eclipse.jdt.launching + 3.20.100 + org.ow2.asm diff --git a/tycho-apitools-plugin/src/main/java/org/eclipse/tycho/apitools/ApiAnalysis.java b/tycho-apitools-plugin/src/main/java/org/eclipse/tycho/apitools/ApiAnalysis.java index d0c0ca3117..00786a281f 100644 --- a/tycho-apitools-plugin/src/main/java/org/eclipse/tycho/apitools/ApiAnalysis.java +++ b/tycho-apitools-plugin/src/main/java/org/eclipse/tycho/apitools/ApiAnalysis.java @@ -39,9 +39,12 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.internal.launching.LaunchingPlugin; import org.eclipse.osgi.service.resolver.ResolverError; import org.eclipse.pde.api.tools.internal.BundleListTargetLocation; import org.eclipse.pde.api.tools.internal.FilterStore; @@ -96,6 +99,7 @@ public ApiAnalysisResult call() throws Exception { Platform.addLogListener((status, plugin) -> debug(status.toString())); printVersion(); disableAutoBuild(); + disableJVMDiscovery(); setTargetPlatform(); deleteAllProjects(); BundleComponent projectComponent = importProject(); @@ -125,6 +129,12 @@ public ApiAnalysisResult call() throws Exception { return result; } + private void disableJVMDiscovery() { + IEclipsePreferences instanceNode = InstanceScope.INSTANCE + .getNode(LaunchingPlugin.getDefault().getBundle().getSymbolicName()); + instanceNode.putBoolean(LaunchingPlugin.PREF_DETECT_VMS_AT_STARTUP, false); + } + private BundleComponent importProject() throws CoreException, IOException { IPath projectPath = IPath.fromOSString(projectDir); IPath projectDescriptionFile = projectPath.append(IProjectDescription.DESCRIPTION_FILE_NAME);