Skip to content

Do not force md download always#11908

Merged
cstamas merged 6 commits intoapache:maven-3.10.xfrom
cstamas:maven-3.10.x-plugin-discovery
Apr 13, 2026
Merged

Do not force md download always#11908
cstamas merged 6 commits intoapache:maven-3.10.xfrom
cstamas:maven-3.10.x-plugin-discovery

Conversation

@cstamas
Copy link
Copy Markdown
Member

@cstamas cstamas commented Apr 8, 2026

My proposal, go back to original behaviour with a twist:

  • discover via project (if present) -- but added slight heuristics to try to prioritize plugins that have prefix in A (ie "spotless" -> "spotless-maven-plugin"), and then try all the remainers if not found
  • discover via G level metadata

Rationale: original change was IMHO wrong: not only it allowed "takeover" of prefix, user was not able to do anything about it. The original code (where this PR goes back to) was done like this on purpose: the user input (POM) is mandatory, so if user defines a plugin, and it has given prefix, that must be used, whatever any remote repository G level metadata says. Only if there is no user instruction, go for prefix discovery via metadata.

Code uses Set and gets rid of the possible double resolution of same plugin, as they may coexist (usually is) in project/build/plugins and project/build/pluginManagement/plugins.

Fixes #11905

Right now, metadata discovery causes all metadata download over and over,
for maven plugins that does not have G level metadata. Usually those plugins
are enlisted in POM. One of most prominent plugin is spotless.

So this PR adds following change:
* discover via G level metadata (will not succeed)
* discover via project (here will)
* try harder via G level metadata (set policy "always")
@cstamas cstamas self-assigned this Apr 8, 2026
@cstamas cstamas added the enhancement New feature or request label Apr 8, 2026
@cstamas cstamas added this to the 3.10.0 milestone Apr 8, 2026
@cstamas cstamas marked this pull request as ready for review April 8, 2026 20:31
@cstamas cstamas marked this pull request as draft April 9, 2026 19:36
@cstamas

This comment was marked as outdated.

@cstamas

This comment was marked as outdated.

@cstamas cstamas marked this pull request as ready for review April 13, 2026 12:44
@cstamas cstamas merged commit 0691e55 into apache:maven-3.10.x Apr 13, 2026
18 checks passed
@cstamas cstamas deleted the maven-3.10.x-plugin-discovery branch April 13, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maven 3.9.12: Plugin prefix resolution re-downloads group metadata on every invocation

2 participants