{"record":{"id":"8ac966da1f01c5d0","repo":"apache/maven","slug":"the-artifact-has-been-relocated-to-8ac966","errorCode":null,"errorMessage":"The artifact {} has been relocated to {}","messagePattern":"The artifact (.+?) has been relocated to (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"impl/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java","lineNumber":183,"sourceCode":"            node = repoSystem.collectDependencies(session, collect).getRoot();\n            result.setDependencyGraph(node);\n        } catch (DependencyCollectionException e) {\n            result.setDependencyGraph(e.getResult().getRoot());\n            result.setCollectionErrors(e.getResult().getExceptions());\n\n            throw new DependencyResolutionException(\n                    result, \"Could not collect dependencies for project \" + project.getId(), e);\n        }\n\n        depRequest.setRoot(node);\n\n        if (logger.isWarnEnabled()) {\n            for (DependencyNode child : node.getChildren()) {\n                if (!child.getRelocations().isEmpty()) {\n                    org.eclipse.aether.artifact.Artifact artifact =\n                            child.getDependency().getArtifact();\n                    String message = artifact instanceof RelocatedArtifact relocated ? relocated.getMessage() : null;\n                    logger.warn(\"The artifact \" + child.getRelocations().get(0) + \" has been relocated to \" + artifact\n                            + (message != null ? \": \" + message : \"\"));\n                }\n            }\n        }\n\n        if (logger.isDebugEnabled()) {\n            node.accept(new DependencyGraphDumper(logger::debug));\n        }\n\n        try {\n            process(result, repoSystem.resolveDependencies(session, depRequest).getArtifactResults());\n        } catch (org.eclipse.aether.resolution.DependencyResolutionException e) {\n            process(result, e.getResult().getArtifactResults());\n\n            throw new DependencyResolutionException(\n                    result, \"Could not resolve dependencies for project \" + project.getId(), e);\n        }\n","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java#L165-L201","documentation":"While collecting the dependency graph, Maven detected that a direct dependency's original coordinates have been relocated by the repository to new coordinates (DependencyNode.getRelocations() is non-empty). Resolution continues against the new location, so this is advisory: nothing fails, but the old coordinates are deprecated and every build re-follows the relocation entries. When the artifact is a RelocatedArtifact, its message (often the reason for the move) is appended to the warning.","triggerScenarios":"DefaultProjectDependenciesResolver.resolve() walks node.getChildren() of the collected graph; any child whose first relocation differs from its current artifact triggers the warning at WARN level. Typical artifacts: javax.xml:jaxb-api relocated to jakarta.xml.bind:jakarta.xml.bind-api, or groupId renames published by the project itself.","commonSituations":"Legacy dependencies whose maintainers renamed groupId/artifactId (Java EE to Jakarta moves, org.apache.commons re-groupings); transitive pulls of old coordinates after a project upgraded to the new ones elsewhere; CI log audits flagging the word 'relocated'.","solutions":["Update the dependency declaration in the POM to the relocated coordinates shown in the warning (the part after 'has been relocated to')","Run mvn dependency:tree -Dincludes=<oldGroupId>:<oldArtifactId> to find which module still declares the old coordinates","If the old coordinate comes in transitively, add a <dependencyManagement> entry pinning the new coordinates or exclude the old one"],"exampleFix":"<!-- before -->\n<dependency>\n  <groupId>javax.xml.bind</groupId>\n  <artifactId>jaxb-api</artifactId>\n  <version>2.3.1</version>\n</dependency>\n\n<!-- after: relocated coordinates -->\n<dependency>\n  <groupId>jakarta.xml.bind</groupId>\n  <artifactId>jakarta.xml.bind-api</artifactId>\n  <version>4.0.1</version>\n</dependency>","handlingStrategy":"validation","validationCode":"// Detect relocated coordinates before Maven warns about them at build time\n// Run: mvn dependency:list -DincludeGroupIds=<old> and compare against the relocation table\ndef relocated = ['javax.xml.bind:jaxb-api': 'jakarta.xml.bind:jakarta.xml.bind-api']\nrelocated.each { oldGav, newGav ->\n  def out = \"mvn -q dependency:list -DincludeGroupIds=${oldGav.split(':')[0]}\".execute().text\n  if (out.contains(oldGav)) throw new GradleException(\"Update $oldGav -> $newGav\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Grep POMs periodically for coordinates known to be relocated (javax.xml.bind, org.javaee, old commons groupIds)","Pin modern coordinates in dependencyManagement so transitive old ones cannot reintroduce themselves","Treat relocation warnings as refactoring debt and schedule them instead of muting the logger"],"tags":["maven","dependencies","relocation","deprecation"],"backgroundTag":"artifact-relocated","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}