{"record":{"id":"d0768f61c6b37f4e","repo":"quarkusio/quarkus","slug":"mixed-dsl-is-not-supported-both-build-and-setting","errorCode":null,"errorMessage":"Mixed DSL is not supported. Both build and settings file need to use either Kotlin or Groovy DSL","messagePattern":"Mixed DSL is not supported\\. Both build and settings file need to use either Kotlin or Groovy DSL","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusPlatformTask.java","lineNumber":147,"sourceCode":"        return quarkusCoreVersion;\n    }\n\n    protected QuarkusProject getQuarkusProject(boolean limitExtensionsToImportedPlatforms) {\n        final GradleMessageWriter log = messageWriter();\n        final ExtensionCatalog catalog = extensionsCatalog(limitExtensionsToImportedPlatforms, log);\n\n        final Path projectDirPath = project.getProjectDir().toPath();\n        final Path rootProjectPath = project.getParent() != null ? project.getRootProject().getProjectDir().toPath()\n                : projectDirPath;\n        final BuildFile buildFile;\n        if (Files.exists(rootProjectPath.resolve(\"settings.gradle.kts\"))\n                && Files.exists(projectDirPath.resolve(\"build.gradle.kts\"))) {\n            buildFile = new GradleKotlinProjectBuildFile(project, catalog);\n        } else if (Files.exists(rootProjectPath.resolve(\"settings.gradle\"))\n                && Files.exists(projectDirPath.resolve(\"build.gradle\"))) {\n            buildFile = new GradleGroovyProjectBuildFile(project, catalog);\n        } else {\n            throw new GradleException(\n                    \"Mixed DSL is not supported. Both build and settings file need to use either Kotlin or Groovy DSL\");\n        }\n        final JavaVersion javaVersion = resolveProjectJavaVersion();\n        return QuarkusProjectHelper.getProject(project.getProjectDir().toPath(), catalog, buildFile, javaVersion, log);\n    }\n\n    private JavaVersion resolveProjectJavaVersion() {\n        TaskCollection<JavaCompile> compileTasks = project.getTasks().withType(JavaCompile.class);\n        if (compileTasks.isEmpty()) {\n            return JavaVersion.NA;\n        }\n        final JavaCompile task = compileTasks.iterator().next();\n        return new JavaVersion(task.getTargetCompatibility());\n    }\n\n    protected GradleMessageWriter messageWriter() {\n        return new GradleMessageWriter(getLogger());\n    }","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusPlatformTask.java#L129-L165","documentation":"getQuarkusProject inspects the root settings file and the project's build file to pick a matching GradleProjectBuildFile (Kotlin or Groovy). If the settings and build files use different DSLs (e.g. settings.gradle.kts with build.gradle, or vice versa), it throws GradleException(\"Mixed DSL is not supported...\") because the tooling cannot parse the project consistently.","triggerScenarios":"Running any Quarkus Gradle task requiring a QuarkusProject when one of these file pairs exists: settings.gradle + build.gradle.kts, or settings.gradle.kts + build.gradle (and neither of the supported combinations).","commonSituations":"Teams migrating Gradle builds to Kotlin DSL incrementally; devs adding build.gradle.kts alongside legacy settings.gradle; copied snippets mixing DSLs.","solutions":["Make the DSL consistent: use settings.gradle.kts with build.gradle.kts (Kotlin), or settings.gradle with build.gradle (Groovy).","Rename the offending file — e.g. convert settings.gradle to settings.gradle.kts if the build file is Kotlin.","Temporarily create both files in the same DSL if third-party tooling requires the other format."],"exampleFix":"// before\nsettings.gradle.kts  +  build.gradle\n\n// after\nsettings.gradle.kts  +  build.gradle.kts","handlingStrategy":"validation","validationCode":"// verify DSL consistency before running Quarkus tasks\ndef root = project.rootDir\ndef kts = file(\"${root}/settings.gradle.kts\").exists()\ndef groovy = file(\"${root}/settings.gradle\").exists()\ndef buildKts = file(\"build.gradle.kts\").exists()\ndef buildGroovy = file(\"build.gradle\").exists()\nassert (kts == buildKts) || (groovy && buildGroovy) : 'Mixed DSL: settings and build files must use the same DSL'","typeGuard":null,"tryCatchPattern":"try { getQuarkusProject() } catch (GradleException e) { if (e.message.contains('Mixed DSL is not supported')) { /* rename build.gradle <-> build.gradle.kts to match settings */ } }","preventionTips":["Standardize the whole build on one DSL (prefer Kotlin DSL).","Never keep both build.gradle and build.gradle.kts in a module.","When migrating to Kotlin DSL, convert settings.gradle and build.gradle together."],"tags":["gradle","kotlin-dsl","groovy","configuration"],"backgroundTag":"mixed-gradle-dsl","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"}