From cd8ebf72fcf2fee9a9637f0a84cbea0d5b6339cd Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Thu, 26 Dec 2024 16:57:30 +0100 Subject: [PATCH] Improve error message when no sources with Gradle This is unfortunate but we probably need to spend a lot more time to fully understand all the consequences of lifting this restriction. Related to #45169 --- .../src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java index ae3555a09e6d4..ab174702a915f 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java @@ -346,7 +346,9 @@ public QuarkusDev extensionJvmOptions(Action ac @TaskAction public void startDev() { if (!sourcesExist()) { - throw new GradleException("The `src/main/java` directory is required, please create it."); + throw new GradleException( + "At least one source directory (e.g. src/main/java, src/main/kotlin) should contain sources before starting Quarkus in dev mode when using Gradle. " + + "Please initialize your project a bit further before restarting Quarkus in dev mode."); } if (!classesExist()) {