{"record":{"id":"1673cbfa18eab793","repo":"quarkusio/quarkus","slug":"compilation-failed","errorCode":null,"errorMessage":"Compilation failed. ","messagePattern":"Compilation failed\\. ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/kotlin/deployment/src/main/java/io/quarkus/kotlin/deployment/KotlinCompilationProvider.java","lineNumber":101,"sourceCode":"        compilerArguments.setFreeArgs(filesToCompile.stream().map(File::getAbsolutePath).collect(Collectors.toList()));\n\n        final K2JVMCompiler compiler = new K2JVMCompiler();\n        final Collection<String> compilerOptions = context.getCompilerOptions(KOTLIN_PROVIDER_KEY);\n\n        if (compilerOptions != null && !compilerOptions.isEmpty()) {\n            compiler.parseArguments(compilerOptions.toArray(new String[0]), compilerArguments);\n        }\n\n        final SimpleKotlinCompilerMessageCollector messageCollector = new SimpleKotlinCompilerMessageCollector();\n        final ExitCode exitCode = compiler.exec(messageCollector, new Services.Builder().build(), compilerArguments);\n\n        if (exitCode != ExitCode.OK) {\n            final String errors = String.join(\"\\n\", messageCollector.getErrors());\n\n            if (exitCode != ExitCode.COMPILATION_ERROR) {\n                throw new RuntimeException(\"Unable to invoke Kotlin compiler. \" + errors);\n            } else if (messageCollector.hasErrors()) {\n                throw new RuntimeException(\"Compilation failed. \" + errors);\n            }\n        }\n    }\n\n    private static class SimpleKotlinCompilerMessageCollector implements MessageCollector {\n\n        private final List<String> errors = new ArrayList<>();\n\n        @Override\n        public void clear() {\n        }\n\n        @Override\n        public boolean hasErrors() {\n            return !errors.isEmpty();\n        }\n\n        public List<String> getErrors() {","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/kotlin/deployment/src/main/java/io/quarkus/kotlin/deployment/KotlinCompilationProvider.java#L83-L119","documentation":"The Quarkus Kotlin deployment module invokes the Kotlin compiler (kotlin-compiler-embedder) to compile Kotlin sources during the Quarkus build. The compiler's diagnostics are gathered in a MessageCollector; when the compiler exits with a non-OK exit code and the exit code is COMPILATION_ERROR with errors recorded, this RuntimeException is thrown joining all collected error messages. It means your Kotlin source code failed to compile, not that the Quarkus build itself is broken.","triggerScenarios":"Running a Quarkus build (mvn compile / quarkus:dev) on a project with Kotlin sources that contain syntax errors, unresolved references, type mismatches, or annotations the Kotlin compiler rejects; also when the Kotlin compiler exits with COMPILATION_ERROR.","commonSituations":"Typos or syntax mistakes introduced while editing .kt files; using a Kotlin language/API feature not supported by the Kotlin version pinned via kotlin-maven-plugin; incompatible kotlin-stdlib vs compiler versions; code generated by Quarkus annotation processing that fails KAPT/KSP; JDK version too new for the embedded Kotlin compiler.","solutions":["Read the joined error messages in the exception — they contain the Kotlin compiler diagnostics with file:line of each compile error; fix the Kotlin source accordingly","Run the Kotlin compiler directly (mvn compile or IDE build) to see full diagnostics with quick-fixes","Check that the Kotlin version (kotlin.version property) is compatible with your JDK and Quarkus version","If errors come from generated code, clean and rebuild: mvn clean compile","Ensure kotlin-maven-plugin is configured before/replacing the default compiler for Kotlin sources"],"exampleFix":"// before\nval x: Int = \"hello\" // type mismatch\n// after\nval x: Int = 42","handlingStrategy":"validation","validationCode":"// Compile before packaging Quarkus\nmvn clean compile   // or open project in IDE; fix reported Kotlin diagnostics\n// ensure kotlin version matches JDK: check <kotlin.version> vs java.version in pom.xml","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fix Kotlin errors surfaced in the exception's joined diagnostics (file:line per error)","Keep kotlin.version aligned with your JDK and Quarkus release","Run mvn compile in CI before the Quarkus package phase","Bump Kotlin compiler/stdlib versions together, never independently"],"tags":["kotlin","compilation","build"],"backgroundTag":"kotlin-compilation-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}