{"record":{"id":"78b6fbb755298a44","repo":"quarkusio/quarkus","slug":"value-value-does-not-follow-module-package-ta","errorCode":null,"errorMessage":"Value '${value}' does not follow module/package=target-module(,target-module) format","messagePattern":"Value '(.+?)' does not follow module/package=target-module\\(,target-module\\) format","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/MutableStandardJvmOption.java","lineNumber":78,"sourceCode":"            default:\n                return toCliGenericArgument();\n        }\n    }\n\n    private List<String> toCliModulePackageList() {\n        if (!hasValue()) {\n            return List.of();\n        }\n        var name = getName();\n        var values = getValues();\n        if (values.size() == 1) {\n            return List.of(DASH_DASH + name + EQUALS + values.iterator().next());\n        }\n        final Map<String, Set<String>> modulePackages = new HashMap<>(values.size());\n        for (String value : values) {\n            final int slash = value.indexOf('=');\n            if (slash < 1) {\n                throw new IllegalArgumentException(\n                        \"Value '\" + value + \"' does not follow module/package=target-module(,target-module) format\");\n            }\n            final Set<String> targetModules = modulePackages.computeIfAbsent(value.substring(0, slash), k -> new HashSet<>());\n            final String[] packageNames = value.substring(slash + 1).split(COMMA);\n            for (String packageName : packageNames) {\n                targetModules.add(packageName);\n            }\n        }\n        final String[] modulePackageList = toSortedArray(modulePackages.keySet());\n        final List<String> result = new ArrayList<>(modulePackageList.length * 2);\n        for (String modulePackage : modulePackageList) {\n            final Set<String> targetModules = modulePackages.get(modulePackage);\n            if (!targetModules.isEmpty()) {\n                result.add(DASH_DASH + name);\n                final StringBuilder sb = new StringBuilder()\n                        .append(modulePackage).append(EQUALS);\n                final String[] targetModuleNames = toSortedArray(targetModules);\n                appendItems(sb, targetModuleNames, COMMA);","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/MutableStandardJvmOption.java#L60-L96","documentation":"When formatting --add-opens / --add-reads style module options to CLI form, MutableStandardJvmOption.toCliModulePackageList requires each stored value to be 'module/package=target-module(,target-module)'. A value without a '=' at index >= 1 (missing, or at position 0) is rejected with this IllegalArgumentException. This happens when building CLI options from multiple values instead of a single-value shortcut.","triggerScenarios":"Calling toCliOptions() on a standard JVM option (e.g. add-opens) whose value set contains a string without the 'source=target' form, e.g. 'java.base/java.lang' (no '=') or '=java.base' (slash at index 0).","commonSituations":"Typing a --add-opens value in configuration as a bare module/package without '=target-module'; copying a --add-exports syntax from documentation with a typo; splitting a property on the wrong delimiter so '=' got lost.","solutions":["Correct the value to include 'module/package=target-module', e.g. 'java.base/java.lang=ALL-UNNAMED'","Check each value before adding: it must contain '=' not at the first character","If only one value is set, note the single-value path bypasses this check — the format is still required for multi-value options"],"exampleFix":"// before\noption.addValue(\"java.base/java.lang\");\n// after\noption.addValue(\"java.base/java.lang=ALL-UNNAMED\");","handlingStrategy":"validation","validationCode":"boolean isValidModulePackageValue(String v) {\n    int i = v.indexOf('=');\n    return i >= 1 && !v.substring(0, i).isBlank();\n}\n// check each value before addValue / toCliOptions","typeGuard":"boolean hasTargetModule(String v) { int i = v.indexOf('='); return i >= 1; }","tryCatchPattern":"try {\n    List<String> cli = option.toCliOptions();\n} catch (IllegalArgumentException e) {\n    throw new IllegalArgumentException(\"Invalid add-opens/add-reads value: \" + e.getMessage(), e);\n}","preventionTips":["Always use the 'module/package=target-module' form for --add-opens/--add-reads values","Validate values with a regex like ^[^=]+/.+=[^=,]+(,[^=,]+)*$ before adding","Copy values from running JVM flags rather than typing them by hand"],"tags":["jvm-options","add-opens","format-validation"],"backgroundTag":"option-format-invalid","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"}