{"record":{"id":"c747427197ea0548","repo":"quarkusio/quarkus","slug":"unexpected-mode","errorCode":null,"errorMessage":"Unexpected mode: ","messagePattern":"Unexpected mode: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/dependency/ApplicationDeploymentClasspathBuilder.java","lineNumber":157,"sourceCode":"    }\n\n    private static Configuration[] getOriginalRuntimeClasspaths(Project project, LaunchMode mode) {\n        List<String> configurationNames;\n        switch (mode) {\n            case TEST:\n                configurationNames = List.of(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME);\n                break;\n            case NORMAL:\n                configurationNames = List.of(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME);\n                break;\n            case DEVELOPMENT:\n                configurationNames = List.of(\n                        ToolingUtils.DEV_MODE_CONFIGURATION_NAME,\n                        JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME,\n                        JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME);\n                break;\n            default:\n                throw new IllegalArgumentException(\"Unexpected mode: \" + mode);\n        }\n        ConfigurationContainer configContainer = project.getConfigurations();\n        return configurationNames.stream()\n                .map(configContainer::getByName)\n                .toArray(Configuration[]::new);\n    }\n\n    private final Project project;\n    private final LaunchMode mode;\n\n    private final String runtimeConfigurationName;\n    private final String platformConfigurationName;\n    private final String deploymentConfigurationName;\n    private final String compileOnlyConfigurationName;\n\n    /**\n     * The platform configuration updates the PlatformImports, but since the PlatformImports don't\n     * have a place to be stored in the project, they're stored here. The way that extensions are","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/dependency/ApplicationDeploymentClasspathBuilder.java#L139-L175","documentation":"ApplicationDeploymentClasspathBuilder.getOriginalRuntimeClasspaths switches over the Quarkus build mode and builds the list of Gradle configurations to inspect (dev mode, test, prod). Any mode value outside the known enum constants hits the default branch, which throws IllegalArgumentException. This indicates an unknown/unhandled QuarkusMode was passed to the builder — normally impossible with the shipped enum, so it usually signals a plugin version mismatch or a bug.","triggerScenarios":"Calling getOriginalRuntimeClasspathAsInput with a mode value not covered by the switch (a new/unknown Quarkus mode enum constant from a mismatched plugin version on the classpath).","commonSituations":"Mixing Quarkus Gradle plugin versions (e.g. a snapshot plugin with an older gradle-model on the classpath); IDE-sync plugins passing an outdated mode enum; custom forks that added a mode without updating this switch.","solutions":["Check the error's appended mode value and compare it with supported modes of your Quarkus version","Align all Quarkus Gradle plugin artifacts to the same version (gradle-model, plugin, IDE plugin)","Run ./gradlew --stop and clear the configuration cache to eliminate stale plugin classpaths","If you use a Quarkus snapshot/PR build, either switch to a release or update all modules consistently","File a Quarkus issue with the mode value if it comes from an unmodified released plugin"],"exampleFix":"// before (build.gradle mixing versions)\nimplementation 'io.quarkus:quarkus-gradle-model:3.99.0'\n// after\nplugins { id 'io.quarkus' version '3.99.0' } // let the plugin bring matching modules","handlingStrategy":"validation","validationCode":"// only pass modes the tooling understands\nif (mode != QuarkusMode.DEV && mode != QuarkusMode.TEST && mode != QuarkusMode.PROD) {\n    throw new IllegalStateException(\"Unsupported mode for classpath building: \" + mode);\n}","typeGuard":null,"tryCatchPattern":"try {\n    builder.getOriginalRuntimeClasspathAsInput(project, mode);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unexpected mode:\")) {\n        // align plugin versions or map the mode to a supported one\n    } else throw e;\n}","preventionTips":["Keep all Quarkus Gradle plugin artifacts at the same version","Never pass mode values from a different Quarkus version's enum","Run ./gradlew --stop and clear configuration cache after plugin upgrades","Test IDE-sync tooling against released plugin versions"],"tags":["gradle","illegal-argument","mode","version-mismatch"],"backgroundTag":"invalid-enum-value","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"}