diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java b/devtools/gradle/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java index f7958d06a7fe6..c13f9412e3ae1 100644 --- a/devtools/gradle/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java +++ b/devtools/gradle/src/main/java/io/quarkus/gradle/builder/QuarkusModelBuilder.java @@ -107,7 +107,7 @@ public Set getWorkspace(Project project, LaunchMode mode) { for (Project subproject : project.getAllprojects()) { final Convention convention = subproject.getConvention(); JavaPluginConvention javaConvention = convention.findPlugin(JavaPluginConvention.class); - if (javaConvention == null) { + if (javaConvention == null || !javaConvention.getSourceSets().getNames().contains(SourceSet.MAIN_SOURCE_SET_NAME)) { continue; } modules.add(getWorkspaceModule(subproject, mode)); diff --git a/devtools/gradle/src/test/resources/multi-module-project/nomain/build.gradle b/devtools/gradle/src/test/resources/multi-module-project/nomain/build.gradle new file mode 100644 index 0000000000000..b8cf19cf75668 --- /dev/null +++ b/devtools/gradle/src/test/resources/multi-module-project/nomain/build.gradle @@ -0,0 +1,8 @@ +plugins { + id 'java-library' +} + + +sourceSets { + remove(named("main")) +} diff --git a/devtools/gradle/src/test/resources/multi-module-project/settings.gradle b/devtools/gradle/src/test/resources/multi-module-project/settings.gradle index 88b65c1ce09c9..671852ed649a6 100644 --- a/devtools/gradle/src/test/resources/multi-module-project/settings.gradle +++ b/devtools/gradle/src/test/resources/multi-module-project/settings.gradle @@ -16,4 +16,4 @@ pluginManagement { } rootProject.name='mutli-module-project' -include 'common', 'application' \ No newline at end of file +include 'common', 'application', 'nomain'