From bda6dec1d22990c63a14c016bf279b7e0db68243 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 14 Jul 2021 13:44:36 +0300 Subject: [PATCH] Improve IDE detection * Test more possible cases for Windows * Support detection for multi-module projects Fixes: #18676 --- .../java/io/quarkus/deployment/ide/IdeProcessor.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/ide/IdeProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/ide/IdeProcessor.java index af6a9700ec2de..e0ecec9777f81 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/ide/IdeProcessor.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/ide/IdeProcessor.java @@ -67,6 +67,9 @@ public class IdeProcessor { if ((jbrIndex > -1) && command.endsWith("java")) { String ideaHome = command.substring(0, jbrIndex); return (ideaHome + "bin" + File.separator + "idea") + (IdeUtil.isWindows() ? ".exe" : ".sh"); + } else if (IdeUtil.isWindows() && (command.endsWith("idea.exe") || command.endsWith("idea64.exe"))) { + // based on input from https://github.com/quarkusio/quarkus/issues/18676#issuecomment-879775007 + return command; } return null; }); @@ -139,6 +142,15 @@ public IdeFileBuildItem detectIdeFiles(LaunchModeBuildItem launchModeBuildItem, result.addAll(ides); } }); + if (result.isEmpty()) { + // hack to try and guess the IDE when using a multi-module project + Path parent = projectRoot.getParent(); + IDE_MARKER_FILES.forEach((file, ides) -> { + if (Files.exists(parent.resolve(file))) { + result.addAll(ides); + } + }); + } return new IdeFileBuildItem(result); }