{"record":{"id":"a70c09ae54d73afc","repo":"apache/maven","slug":"range-defies-version-ordering","errorCode":null,"errorMessage":"Range defies version ordering: {}","messagePattern":"Range defies version ordering: (.+?)","errorType":"validation","errorClass":"InvalidVersionSpecificationException","httpStatus":null,"severity":"warning","filePath":"compat/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java","lineNumber":195,"sourceCode":"\n            restriction = new Restriction(version, lowerBoundInclusive, version, upperBoundInclusive);\n        } else {\n            String lowerBound = process.substring(0, index).trim();\n            String upperBound = process.substring(index + 1).trim();\n\n            ArtifactVersion lowerVersion = null;\n            if (!lowerBound.isEmpty()) {\n                lowerVersion = new DefaultArtifactVersion(lowerBound);\n            }\n            ArtifactVersion upperVersion = null;\n            if (!upperBound.isEmpty()) {\n                upperVersion = new DefaultArtifactVersion(upperBound);\n            }\n\n            if (upperVersion != null && lowerVersion != null) {\n                int result = upperVersion.compareTo(lowerVersion);\n                if (result < 0 || (result == 0 && (!lowerBoundInclusive || !upperBoundInclusive))) {\n                    throw new InvalidVersionSpecificationException(\"Range defies version ordering: \" + spec);\n                }\n            }\n\n            restriction = new Restriction(lowerVersion, lowerBoundInclusive, upperVersion, upperBoundInclusive);\n        }\n\n        return restriction;\n    }\n\n    public static VersionRange createFromVersion(String version) {\n        if (DefaultArtifact.empty(version)) {\n            return null;\n        }\n        VersionRange cached = CACHE_VERSION.get(version);\n        if (cached == null) {\n            List<Restriction> restrictions = Collections.emptyList();\n            cached = new VersionRange(new DefaultArtifactVersion(version), restrictions);\n            CACHE_VERSION.put(version, cached);","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java#L177-L213","documentation":"maven.repo.local was supplied as a JVM system property, typically MAVEN_OPTS='-Dmaven.repo.local=...' or JAVA_TOOL_OPTIONS injection; Maven still reads it but warns that this route is deprecated. The supported route is a user property: -Dmaven.repo.local on the mvn command line or .mvn/maven-user.properties.","triggerScenarios":"Setting the local repository path through JVM system properties instead of a Maven user property; common in container images that export MAVEN_OPTS with the repository location.","commonSituations":"CI builders pinning the cache location via environment; Docker images with MAVEN_OPTS=-Dmaven.repo.local baked in; migration from older Maven versions where this was tolerated silently.","solutions":["Pass it as a Maven argument: mvn -Dmaven.repo.local=/data/m2repo clean install","Or persist it in .mvn/maven-user.properties at the project root","Remove the -D from MAVEN_OPTS/JAVA_TOOL_OPTIONS so the warning stops appearing"],"exampleFix":"# before\nexport MAVEN_OPTS=-Dmaven.repo.local=/data/m2repo\nmvn clean install\n# after: Maven user property\nmvn -Dmaven.repo.local=/data/m2repo clean install","handlingStrategy":"validation","validationCode":"case $MAVEN_OPTS$JAVA_TOOL_OPTIONS in\n  *maven.repo.local*)\n    echo 'use mvn -Dmaven.repo.local=... or .mvn/maven-user.properties instead'\n    exit 1 ;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Put the repository path in .mvn/maven-user.properties for reproducible builds","Use .mvn/jvm.config for JVM flags only, never for maven.* properties"],"tags":["maven","cli","system-property","local-repository","deprecation"],"backgroundTag":"deprecated-system-property","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}