gastaldi opened a new issue, #12019:
URL: https://github.com/apache/maven/issues/12019

   ### Affected version
   
   3.9.12+ (regression introduced by a6d33f4934 / #11067)
   
   ### Bug description
   
   Since the "Simplify prefix resolution" change (a6d33f4934, 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:
      ```xml
      <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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to