{"record":{"id":"5a43c3399bc53f18","repo":"apache/maven","slug":"the-artifact-has-no-valid-ranges","errorCode":null,"errorMessage":"The artifact has no valid ranges","messagePattern":"The artifact has no valid ranges","errorType":"exception","errorClass":"OverConstrainedVersionException","httpStatus":null,"severity":"warning","filePath":"compat/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java","lineNumber":402,"sourceCode":"                // move on to next in r2\n                if (i2.hasNext()) {\n                    res2 = i2.next();\n                } else {\n                    done = true;\n                }\n            }\n        }\n\n        return restrictions;\n    }\n\n    public ArtifactVersion getSelectedVersion(Artifact artifact) throws OverConstrainedVersionException {\n        ArtifactVersion version;\n        if (recommendedVersion != null) {\n            version = recommendedVersion;\n        } else {\n            if (restrictions.isEmpty()) {\n                throw new OverConstrainedVersionException(\"The artifact has no valid ranges\", artifact);\n            }\n\n            version = null;\n        }\n        return version;\n    }\n\n    public boolean isSelectedVersionKnown(Artifact artifact) throws OverConstrainedVersionException {\n        boolean value = false;\n        if (recommendedVersion != null) {\n            value = true;\n        } else {\n            if (restrictions.isEmpty()) {\n                throw new OverConstrainedVersionException(\"The artifact has no valid ranges\", artifact);\n            }\n        }\n        return value;\n    }","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java#L384-L420","documentation":"Building the effective settings (user plus global settings.xml plus project configuration) returned SettingsProblem entries. This header is printed, each problem follows as 'message @ location', and the build continues with the merged settings. Later oddities such as missing mirrors, servers, or profiles often trace back to these skipped pieces.","triggerScenarios":"A settings.xml with malformed XML, unknown or misplaced elements, duplicate mirror or server ids, or invalid values such as a non-boolean offline flag.","commonSituations":"Hand-edited settings.xml after onboarding new repositories; IDE-injected settings layers; CI copying templates that drift from the schema.","solutions":["Read each 'message @ location' line and fix the named element in that settings.xml","Check the file parses: xmllint --noout ~/.m2/settings.xml","Compare against the settings reference: element order and nesting matter","Re-run mvn and verify the warning block no longer appears"],"exampleFix":"<!-- before: duplicate mirror id 'corp' -->\n<mirrors>\n  <mirror><id>corp</id><url>https://nws1.example.com/repo</url><mirrorOf>central</mirrorOf></mirror>\n  <mirror><id>corp</id><url>https://nws2.example.com/repo</url><mirrorOf>*</mirrorOf></mirror>\n</mirrors>\n<!-- after: unique ids -->\n<mirrors>\n  <mirror><id>corp-central</id><url>https://nws1.example.com/repo</url><mirrorOf>central</mirrorOf></mirror>\n  <mirror><id>corp-all</id><url>https://nws2.example.com/repo</url><mirrorOf>*</mirrorOf></mirror>\n</mirrors>","handlingStrategy":"validation","validationCode":"xmllint --noout ~/.m2/settings.xml 2>&1\nxmllint --noout /etc/maven/settings.xml 2>&1 || true   # global settings, if present","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep settings.xml in version control and let CI copy it in","Use documented element order; avoid hand-editing around credentials","Run mvn help:effective-settings periodically to see what Maven actually merged"],"tags":["maven","settings-xml","configuration","maven-embedder"],"backgroundTag":"settings-xml-invalid","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}