apache/maven · warning

The extension {} has been relocated to {}{}

Error message

The extension {} has been relocated to {}{}

What it means

The extension-resolution twin of the plugin relocation warning: DefaultPluginDependenciesResolver reads the artifact descriptor for a core extension declared under <build><extensions> (or -Dmaven.ext.class.path artifacts). If that descriptor contains relocations, Maven warns 'The extension <original> has been relocated to <new>' and proceeds to resolveInternal() with the relocated artifact.

Source

Thrown at impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java:198

        try {
            DefaultRepositorySystemSession pluginSession = new DefaultRepositorySystemSession(session);
            pluginSession.setArtifactDescriptorPolicy(new SimpleArtifactDescriptorPolicy(true, false));

            ArtifactDescriptorRequest request =
                    new ArtifactDescriptorRequest(pluginArtifact, repositories, REPOSITORY_CONTEXT);
            request.setTrace(trace);
            ArtifactDescriptorResult result = repoSystem.readArtifactDescriptor(pluginSession, request);

            for (MavenPluginDependenciesValidator dependenciesValidator : dependenciesValidators) {
                dependenciesValidator.validate(session, pluginArtifact, result);
            }

            pluginArtifact = result.getArtifact();

            if (logger.isWarnEnabled() && !result.getRelocations().isEmpty()) {
                String message =
                        pluginArtifact instanceof RelocatedArtifact relocated ? ": " + relocated.getMessage() : "";
                logger.warn(
                        "The extension {} has been relocated to {}{}",
                        result.getRelocations().get(0),
                        pluginArtifact,
                        message);
            }
            return resolveInternal(plugin, pluginArtifact, dependencyFilter, repositories, session);
        } catch (ArtifactDescriptorException e) {
            throw new PluginResolutionException(plugin, e.getResult().getExceptions(), e);
        }
    }

    @Deprecated
    @Override
    public DependencyResult resolvePlugin(
            Plugin plugin,
            Artifact artifact,
            DependencyFilter dependencyFilter,
            List<RemoteRepository> repositories,

View on GitHub (pinned to e4093d4e12)

Solutions

  1. Update the <extension> coordinates in the POM to the relocated GAV from the warning.
  2. Upgrade the extension to its latest release, which typically lives at the new coordinates.
  3. Verify the extension is still needed at all — many relocated artifacts (e.g. wagon providers) have modern replacements.

Example fix

<!-- before -->
<build>
  <extensions>
    <extension>
      <groupId>org.apache.maven.wagon</groupId>
      <artifactId>wagon-ssh-external</artifactId>
      <version>2.10</version>
    </extension>
  </extensions>
</build>

<!-- after: relocated/current coordinates -->
<extension>
  <groupId>org.apache.maven.wagon</groupId>
  <artifactId>wagon-ssh-external</artifactId>
  <version>3.5.3</version>
</extension>
Defensive patterns

Strategy: fallback

Validate before calling

# guard: verify extension coordinates resolve without relocation
mvn dependency:get -Dartifact=org.apache.maven.wagon:wagon-ssh-external:3.5.3 \
  2>&1 | grep -i relocated && echo 'extension moved; update <extensions> block'

Prevention

When it happens

Trigger: Declaring a <build><extensions><extension> whose coordinates were relocated upstream (e.g. wagon providers, takari/tycho artifacts moved to new groupIds); referencing an old extension version after its project changed coordinates.

Common situations: Build-extensions blocks copied from old templates; CI images pinning legacy extension coordinates; dependency audits noticing the actual resolved extension differs from the POM.

Related errors


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/ec39c92a735151ee. Report an issue: GitHub.