{"record":{"id":"47df3608ea3a52b9","repo":"OpenAPITools/openapi-generator","slug":"both-s-and-s-properties-were-set-with-different","errorCode":null,"errorMessage":"Both %s and %s properties were set with different value.","messagePattern":"Both (.+?) and (.+?) properties were set with different value\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java","lineNumber":216,"sourceCode":"\n        importMapping.put(\"Headers\", helidonMajorVersion == 3 ? \"io.helidon.http.common.Headers\" : \"io.helidon.http.Headers\");\n        importMapping.put(\"Optional\", \"java.util.Optional\");\n        importMapping.put(\"Collectors\", \"java.util.stream.Collectors\");\n\n        String userHelidonVersion = \"\";\n        String userParentVersion = \"\";\n\n        if (additionalProperties.containsKey(CodegenConstants.PARENT_VERSION)) {\n            userParentVersion = additionalProperties.get(CodegenConstants.PARENT_VERSION).toString();\n        }\n\n        if (additionalProperties.containsKey(HELIDON_VERSION)) {\n            userHelidonVersion = additionalProperties.get(HELIDON_VERSION).toString();\n        }\n\n        if (!userHelidonVersion.isEmpty()) {\n            if (!userParentVersion.isEmpty() && !userHelidonVersion.equals(userParentVersion)) {\n                throw new IllegalArgumentException(\n                        String.format(Locale.ROOT,\n                                \"Both %s and %s properties were set with different value.\",\n                                CodegenConstants.PARENT_VERSION,\n                                HELIDON_VERSION));\n            }\n            setHelidonVersion(userHelidonVersion);\n\n        } else if (!userParentVersion.isEmpty()) {\n            setHelidonVersion(userParentVersion);\n        } else {\n            setHelidonVersion(VersionUtil.instance().defaultVersion());\n        }\n\n        if (helidonMajorVersion > 3) {\n            importMapping.put(\"Status\", \"io.helidon.http.Status\");\n            importMapping.put(\"HexFormat\", \"java.util.HexFormat\");\n        }\n","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java#L198-L234","documentation":"Thrown by JavaHelidonCommonCodegen when both helidonVersion and parentVersion additional properties are set to different strings. The Helidon generator derives its toolchain from helidonVersion but also honors the generic parentVersion; when both are present they must agree, otherwise the generated pom would mix incompatible Helidon BOMs and parent POMs. If only one is set, it wins; if neither, the detected default Helidon version is used.","triggerScenarios":"Passing --additional-properties helidonVersion=3.2.0,parentVersion=4.0.0 (any mismatched pair) to -g java-helidon-server or -g java-helidon-client. Commonly happens when a CI template sets parentVersion for the Maven parent while a developer adds helidonVersion to pin a different release, or when upgrading one property in a shared config but not the other.","commonSituations":"Platform teams standardize parentVersion across many generators, while the Helidon-specific module pins helidonVersion; after a Helidon upgrade (3.x to 4.x) only one of the two is bumped. Also appears when generating Helidon SE vs MP flavors with a copied config where the versions drifted.","solutions":["Set both properties to the same version: helidonVersion=4.1.0,parentVersion=4.1.0","Or remove one of them — helidonVersion alone is sufficient for Helidon projects","If your build requires a specific parent POM version, update helidonVersion to match it, not the other way around","Centralize the version in one CI variable and inject it into both keys to keep them synchronized"],"exampleFix":"# before\nopenapi-generator-cli generate -g java-helidon-server -i api.yaml \\\n  --additional-properties helidonVersion=3.2.0,parentVersion=4.0.0\n\n# after\nopenapi-generator-cli generate -g java-helidon-server -i api.yaml \\\n  --additional-properties helidonVersion=4.0.0,parentVersion=4.0.0","handlingStrategy":"validation","validationCode":"String helidon = (String) opts.get(\"helidonVersion\");\nString parent = (String) opts.get(\"parentVersion\");\nif (helidon != null && parent != null && !helidon.equals(parent)) {\n    throw new IllegalArgumentException(\"helidonVersion=\" + helidon + \" and parentVersion=\" + parent + \" must match; set only one\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    config.processOpts();\n} catch (IllegalArgumentException e) {\n    // version-pair mismatch: safe to fail and prompt the caller — nothing was generated\n    throw new ConfigConflictException(\"Helidon version options conflict: \" + e.getMessage(), e);\n}","preventionTips":["Derive helidonVersion and parentVersion from a single CI variable so they can never diverge","Prefer setting only helidonVersion for Helidon projects; parentVersion is redundant there","Add a config linter rule: version-typed properties that alias each other must be equal or mutually exclusive"],"tags":["java","helidon","openapi-generator","version-management","maven","configuration","option-validation"],"backgroundTag":"conflicting-version-properties","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}