cstamas commented on issue #11596:
URL: https://github.com/apache/maven/issues/11596#issuecomment-3699540999

   The `${prefix}-maven-plugin` was never preferred, in those cases prefix was 
used as part of heuristic (during plugin build time) to figure out wanted 
prefix, but many plugins artifactId did not follow this pattern and literally 
ended up prefix-less. Hence, while started supporting Maven 3 and Maven 4 
plugins in parallel, in Maven Plugin Tools we made prefix _mandatory_ 
https://github.com/apache/maven-plugin-tools/issues/767
   
   With that, there was another bug in Maven: excessive plugin resolution 
(basically Maven resolved all plugins in project) when invoking ad-hoc plugin 
goals: https://github.com/apache/maven/issues/11067
   
   And finally we got a bit of step-back too, as for example spotless lacks G 
metadata in Central https://github.com/apache/maven/issues/11252
   
   So, in short: Maven when looking for "prefix resolution", it does it in this 
order:
   * uses repository G level metadata (for configured plugin groups) -- is fast 
but requires "good metadata"
   * (if project present) falls back to POM defined plugins -- is slow, as it 
needs to blindly resolve and crank up plugins to figure out prefix, if 
applicable.
   
   All that said, I can envision and improvement: in your case (invalid 
metadata) Maven resolves prefix `spotless` to 
`org.apache.avro:avro-maven-plugin` GA, and maybe should warn or even fail, as 
once avro-maven-plugin is resolved and Plugin descriptor loaded, it becomes 
clear that `spotless` prefix != `avro` prefix (IF avro-maven-plugin does have 
prefix!).


-- 
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