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
- Have
<pluginGroup>io.quarkus</pluginGroup> in settings.xml
- 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>
- 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.
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 viaBuildPluginManager.loadPlugin()and checked itsgoalPrefix. 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
<pluginGroup>io.quarkus</pluginGroup>insettings.xmlmvn quarkus:devExpected behavior
Maven resolves
quarkus:tocom.redhat.quarkus.platform:quarkus-maven-plugin(the POM-declared plugin), as it did in 3.9.11 and earlier.Actual behavior
Maven resolves
quarkus:toio.quarkus:quarkus-maven-plugin(from settings.xml pluginGroup), ignoring the POM-declared plugin. This causesquarkus:devto 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.