Skip to content

Plugin prefix resolution ignores POM-declared plugins with non-settings groupId since 3.9.12 #12019

@gastaldi

Description

@gastaldi

Affected version

3.9.12+ (regression introduced by a6d33f4 / #11067)

Bug description

Since the "Simplify prefix resolution" change (a6d33f4, backport of 2b7bb9c), plugin prefix resolution no longer finds plugins declared in the POM when their groupId differs from the settings.xml <pluginGroup> entries.

Before 3.9.12: DefaultPluginPrefixResolver.resolveFromProject() loaded each POM plugin's descriptor via BuildPluginManager.loadPlugin() and checked its goalPrefix. This gave POM-declared plugins priority over settings.xml pluginGroups.

Since 3.9.12: resolveFromProject() was removed entirely. All resolution now goes through repository metadata (maven-metadata.xml). POM plugins with non-settings groupIds are added to the candidates map, but their repository metadata may not contain the prefix mapping, so the resolution falls through to settings.xml pluginGroups.

Steps to reproduce

  1. Have <pluginGroup>io.quarkus</pluginGroup> in settings.xml
  2. Configure a project POM with:
    <plugin>
        <groupId>com.redhat.quarkus.platform</groupId>
        <artifactId>quarkus-maven-plugin</artifactId>
        <version>3.27.3.SP1-redhat-00002</version>
        <extensions>true</extensions>
        <executions>
            <execution>
                <goals>
                    <goal>build</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
  3. Run mvn quarkus:dev

Expected behavior

Maven resolves quarkus: to com.redhat.quarkus.platform:quarkus-maven-plugin (the POM-declared plugin), as it did in 3.9.11 and earlier.

Actual behavior

Maven resolves quarkus: to io.quarkus:quarkus-maven-plugin (from settings.xml pluginGroup), ignoring the POM-declared plugin. This causes quarkus:dev to fail because the invoked plugin's groupId doesn't match the one configured in the POM.

Notes

The original fix (#11067) addressed a valid performance problem (downloading all POM plugins just to resolve a prefix). A correct fix should avoid downloading all plugin descriptors while still giving POM-declared plugins priority — for example, by checking repository metadata for POM plugin groupIds before falling back to settings.xml pluginGroups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions