{"record":{"id":"70c3a266c109ffd1","repo":"apache/maven","slug":"the-artifact-has-been-relocated-to","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/plugin/internal/DefaultPluginDependenciesResolver.java","lineNumber":126,"sourceCode":"        try {\n            DefaultRepositorySystemSession pluginSession = new DefaultRepositorySystemSession(session);\n            pluginSession.setArtifactDescriptorPolicy(new SimpleArtifactDescriptorPolicy(true, false));\n\n            ArtifactDescriptorRequest request =\n                    new ArtifactDescriptorRequest(pluginArtifact, repositories, REPOSITORY_CONTEXT);\n            request.setTrace(trace);\n            ArtifactDescriptorResult result = repoSystem.readArtifactDescriptor(pluginSession, request);\n\n            for (MavenPluginDependenciesValidator dependenciesValidator : dependenciesValidators) {\n                dependenciesValidator.validate(session, pluginArtifact, result);\n            }\n\n            pluginArtifact = result.getArtifact();\n\n            if (logger.isWarnEnabled() && !result.getRelocations().isEmpty()) {\n                String message =\n                        pluginArtifact instanceof RelocatedArtifact relocated ? \": \" + relocated.getMessage() : \"\";\n                logger.warn(\n                        \"The artifact {} has been relocated to {}{}\",\n                        result.getRelocations().get(0),\n                        pluginArtifact,\n                        message);\n            }\n\n            String requiredMavenVersion = (String) result.getProperties().get(\"prerequisites.maven\");\n            if (requiredMavenVersion != null) {\n                Map<String, String> props = new LinkedHashMap<>(pluginArtifact.getProperties());\n                props.put(\"requiredMavenVersion\", requiredMavenVersion);\n                pluginArtifact = pluginArtifact.setProperties(props);\n            }\n        } catch (ArtifactDescriptorException e) {\n            throw new PluginResolutionException(plugin, e.getResult().getExceptions(), e);\n        }\n\n        try {\n            ArtifactRequest request = new ArtifactRequest(pluginArtifact, repositories, REPOSITORY_CONTEXT);","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java#L108-L144","documentation":"While reading a plugin's artifact descriptor (RepositorySystem.readArtifactDescriptor) in DefaultPluginDependenciesResolver, the resolver applies relocation metadata. If the descriptor recorded relocations, the plugin artifact you referenced was moved, so Maven warns 'The artifact <original> has been relocated to <new>' (plus the relocation message, if any) and continues with the new coordinates. Purely informational: the build uses the relocated artifact transparently.","triggerScenarios":"Declaring or implicitly pulling a plugin whose POM/metadata contains <relocation> to new groupId/artifactId — e.g. javax.xml.bind:jaxb-* -> org.glassfish.jaxb:*, commons-logging stubs, plugins moved to new groupIds; first resolution after an upstream project relocates.","commonSituations":"Ecosystem-wide coordinate migrations (Jakarta EE, new groupIds); stale plugin versions whose maintainers published relocations; builds continuing to work but pulling different GAVs than the POM says — surprising during dependency audits or license scanning.","solutions":["Update the plugin declaration in the POM to the relocated coordinates shown in the warning.","Upgrade to a plugin version that natively uses the new coordinates (often the reason for relocation).","If the relocation is unexpected, verify the repository/mirror serving metadata is trustworthy and not injecting relocations."],"exampleFix":"<!-- before: relocated plugin coordinates -->\n<plugin>\n  <groupId>com.example.old</groupId>\n  <artifactId>build-helper</artifactId>\n</plugin>\n\n<!-- after: use relocated coordinates from the warning -->\n<plugin>\n  <groupId>org.codehaus.mojo</groupId>\n  <artifactId>build-helper-maven-plugin</artifactId>\n  <version>3.6.0</version>\n</plugin>","handlingStrategy":"fallback","validationCode":"# guard: detect relocation before committing coordinates\nmvn dependency:get -Dartifact=old.gid:old-art:1.0 2>&1 | grep -i 'has been relocated' \\\n  && echo 'update POM to relocated coordinates'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Act on relocation warnings immediately: replace GAVs in the POM so builds match what actually resolves.","Watch upstream release notes for coordinate migrations (groupId changes) and bump versions proactively."],"tags":["maven","plugin-resolution","relocation","artifact-metadata","repository"],"backgroundTag":"maven-artifact-relocated","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}