{"record":{"id":"02a7df383c1d4bee","repo":"apache/maven","slug":"unbounded-range","errorCode":null,"errorMessage":"Unbounded range: {}","messagePattern":"Unbounded range: (.+?)","errorType":"validation","errorClass":"InvalidVersionSpecificationException","httpStatus":null,"severity":"warning","filePath":"compat/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java","lineNumber":123,"sourceCode":"        List<Restriction> restrictions = new ArrayList<>();\n        String process = spec;\n        ArtifactVersion version = null;\n        ArtifactVersion upperBound = null;\n        ArtifactVersion lowerBound = null;\n\n        while (process.startsWith(\"[\") || process.startsWith(\"(\")) {\n            int index1 = process.indexOf(')');\n            int index2 = process.indexOf(']');\n\n            int index = index2;\n            if (index2 < 0 || index1 < index2) {\n                if (index1 >= 0) {\n                    index = index1;\n                }\n            }\n\n            if (index < 0) {\n                throw new InvalidVersionSpecificationException(\"Unbounded range: \" + spec);\n            }\n\n            Restriction restriction = parseRestriction(process.substring(0, index + 1));\n            if (lowerBound == null) {\n                lowerBound = restriction.getLowerBound();\n            }\n            if (upperBound != null) {\n                if (restriction.getLowerBound() == null\n                        || restriction.getLowerBound().compareTo(upperBound) < 0) {\n                    throw new InvalidVersionSpecificationException(\"Ranges overlap: \" + spec);\n                }\n            }\n            restrictions.add(restriction);\n            upperBound = restriction.getUpperBound();\n\n            process = process.substring(index + 1).trim();\n\n            if (process.startsWith(\",\")) {","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java#L105-L141","documentation":"The invoked CLI option is annotated as deprecated in CLIManager (for example -llr for Maven 2 legacy local repository behavior, or the -gs/-gt alternate-path options). Maven prints the flag with its since-version and reason; when the deprecation description starts with 'UNSUPPORTED:' the message is upgraded to an error and Maven exits with code 1 via ExitException.","triggerScenarios":"Passing a deprecated flag on the command line; the check runs over every option present in the parsed command line before the build starts.","commonSituations":"CI scripts pinned to old Maven versions run against a newer Maven; wrapper distributions upgraded without updating pipelines; copy-pasted mvn invocations carrying legacy flags.","solutions":["Drop the flag from scripts; mvn -h lists current deprecations and their replacements","Adopt the supported replacement named in the deprecation description","Temporarily pin the previous Maven version via the wrapper while migrating scripts","Grep CI pipelines for the deprecated flag so upgrades fail fast instead of at build time"],"exampleFix":"# before\nmvn -llr clean install\n# after: deprecated Maven 2 legacy local repository flag removed\nmvn clean install","handlingStrategy":"validation","validationCode":"# review current deprecations and cross-check your CI scripts before upgrading Maven\nmvn -h 2>&1 | grep -i -B1 -A1 deprecated","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run mvn -h after each Maven upgrade and diff against the flags used in your scripts","Centralize Maven invocations in one shared CI script so flags are upgraded once","Watch Maven release notes for options marked UNSUPPORTED, which hard-fail the build"],"tags":["maven","cli","deprecation","maven-embedder"],"backgroundTag":"deprecated-cli-option","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}