{"record":{"id":"09e45294e6542df7","repo":"quarkusio/quarkus","slug":"because-the-project-does-not-have-any-source-set","errorCode":null,"errorMessage":"because the project does not have any source set / among the following source sets:","messagePattern":"because the project does not have any source set / among the following source sets:","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/tooling/GradleApplicationModelBuilder.java","lineNumber":313,"sourceCode":"                    SourceSetContainer sourceSets = projectDep.getExtensions().getByType(SourceSetContainer.class);\n\n                    SourceSet mainSourceSet = sourceSets.findByName(SourceSet.MAIN_SOURCE_SET_NAME);\n                    if (mainSourceSet == null) {\n                        // try Kotlin multiplatform\n                        mainSourceSet = sourceSets.findByName(\"jvmMain\");\n                        if (mainSourceSet == null) {\n                            var msg = new StringBuilder()\n                                    .append(\"Failed to determine the main source set of \").append(projectDep.getPath());\n                            var i = sourceSets.iterator();\n                            if (!i.hasNext()) {\n                                msg.append(\" because the project does not have any source set\");\n                            } else {\n                                msg.append(\" among the following source sets: \").append(i.next().getName());\n                                while (i.hasNext()) {\n                                    msg.append(\", \").append(i.next().getName());\n                                }\n                            }\n                            throw new RuntimeException(msg.toString());\n                        }\n                    }\n                    dep = toDependency(a, mainSourceSet);\n                    modelBuilder.addDependency(dep);\n                } else if (isDependency(a)) {\n                    dep = toDependency(a);\n                    modelBuilder.addDependency(dep);\n                }\n                if (dep != null) {\n                    modelBuilder.addDependency(dep);\n                    clearReloadableFlag = true;\n                }\n            }\n            if (dep != null) {\n                if (dep.isRuntimeExtensionArtifact()) {\n                    clearReloadableFlag = true;\n                }\n                dep.setDeploymentCp();","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/tooling/GradleApplicationModelBuilder.java#L295-L331","documentation":"Thrown by GradleApplicationModelBuilder.processDeploymentDependency when a Quarkus deployment dependency (artifactId ending in -deployment) resolves to a Gradle project whose source sets contain no match for the required source set. The builder needs to associate the deployment artifact with a source set of the main application project; when none exists or none of the available source sets can be matched, it aborts with a RuntimeException listing the source sets it inspected. This indicates the Gradle project structure is inconsistent with what Quarkus expects.","triggerScenarios":"Running a Quarkus Gradle build (quarkusDev, quarkusBuild, or the model-building phase) where collectExtensionDependencies walks deployment dependencies and calls processDeploymentDependency on a project dependency that has no matching source set — e.g. the deployment artifact maps to a project whose main source set was not created, or the required source set name does not exist among the project's source sets.","commonSituations":"Multi-project Gradle builds where a library subproject's quarkus deployment dependency is wired to the wrong project; custom source set configurations (renaming/removing the 'main' source set); applying the Quarkus plugin in a project with no Java/Kotlin source sets; version mismatches between quarkus-gradle-plugin and the Quarkus BOM where deployment artifact naming assumptions break.","solutions":["Ensure the subproject providing the Quarkus extension has a 'main' source set (apply the java/kotlin plugin and keep the default source set intact).","Check which source sets are listed in the message; add or rename your source set so it matches what the Quarkus Gradle plugin expects.","Verify the deployment dependency (artifactId-suffix '-deployment') points to the intended project in your Gradle dependency declarations.","Align the Quarkus Gradle plugin version with your Quarkus platform/BOM version to avoid mismatched model-building assumptions.","Run with --stacktrace/-Dorg.gradle.debug to confirm which dependency triggers it and fix that module's configuration."],"exampleFix":"// before (build.gradle of a subproject with no java plugin)\nplugins { id 'io.quarkus' }\n// after\nplugins { id 'java'; id 'io.quarkus' }\nsourceSets { main { java { srcDirs 'src/main/java' } } }","handlingStrategy":"validation","validationCode":"// In your Gradle build, before invoking Quarkus tasks:\ndef ss = project.sourceSets.findByName('main')\nif (ss == null) throw new GradleException(\"Project ${project.name} has no 'main' source set required by the Quarkus Gradle plugin\")","typeGuard":null,"tryCatchPattern":"try {\n    quarkusBuild()\n} catch (RuntimeException e) {\n    if (e.message?.contains('among the following source sets')) {\n        logger.error('Quarkus deployment dependency could not be mapped to a source set: ' + e.message)\n    } else throw e\n}","preventionTips":["Always apply the java (or kotlin) plugin in projects that use the Quarkus plugin","Do not rename or remove the default 'main' source set in Quarkus modules","Keep the Quarkus Gradle plugin version aligned with the Quarkus platform version","Run ./gradlew tasks in CI early to catch model-building failures before full builds"],"tags":["gradle","quarkus","source-set","build"],"backgroundTag":"missing-source-set","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}