From 47a19cc825190fa57cca9fe83c6024dcb767886c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sun, 15 Dec 2024 06:33:58 +0100 Subject: [PATCH] Do not automatically detect JVMs on CI systems Automatic detection on CI systems can cause a lot of trouble (e.g. memory consumption, time to read the jvms, old jvms lingering around) and is generally not useful as a CI has usually a dedicated and fixed setup to run with. This adds a check for the common 'CI' environment variable that is usually defined by all usual CI/CD pipelines to indicate a job is running on a CI server to skip the detection regardless of preferences configuration. If one absolutely want the feature even for CI, the system-property 'DetectVMInstallationsJob.disabled' can be set to false to restore previous behavior. --- .../launching/DetectVMInstallationsJob.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DetectVMInstallationsJob.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DetectVMInstallationsJob.java index 7a0b9c15e3..0373047b08 100644 --- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DetectVMInstallationsJob.java +++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DetectVMInstallationsJob.java @@ -46,6 +46,20 @@ */ public class DetectVMInstallationsJob extends Job { + /** + * CI is a common variable defined in CI/CDI servers like Jenkins, Gitlab, Github, ... to indicate it is a CI environment + */ + private static final String ENV_CI = "CI"; //$NON-NLS-1$ + /** + * Property that can be defined to control general behavior + *