Skip to content

Fix #326: resolve a described plugin against plugin repositories - #453

Merged
slawekjaranowski merged 1 commit into
apache:masterfrom
arturobernalg:fix/326-describe-plugin-repositories
Nov 9, 2026
Merged

slawekjaranowski merged 1 commit into
apache:masterfrom
arturobernalg:fix/326-describe-plugin-repositories

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

Fixes #326.

AbstractHelpMojo.resolveArtifact() always resolved against project.getRemoteProjectRepositories(). DescribeMojo calls it to resolve a plugin's own jar/pom in two places: the fallback name lookup when a plugin descriptor has no name, and isReportGoal()'s check for whether a goal implements MavenReport. Both are resolving the plugin itself, so a plugin published only to a and not also declared as a project failed to resolve there even though Maven resolved and ran the plugin fine during a normal build.

Added a resolveArtifact(artifact, repositories) overload taking an explicit repository list, with the existing resolveArtifact(artifact) delegating to it with project repositories unchanged for its other callers (getMavenProject, EvaluateMojo). DescribeMojo's three plugin-resolution call sites now pass project.getRemotePluginRepositories(). Full module suite, checkstyle and spotless pass locally.

To make clear that you license your contribution under the Apache License Version 2.0, January 2004, check one of the following:

  • I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004
  • I hereby declare that I have filed an Apache Individual Contributor License Agreement.

AbstractHelpMojo.resolveArtifact() always resolved against
project.getRemoteProjectRepositories(). DescribeMojo calls it to
resolve a plugin's own jar/pom in two places: the fallback name
lookup when a plugin descriptor has no name, and isReportGoal()'s
check for whether a goal implements MavenReport. Both are resolving
the plugin itself, so a plugin published only to a <pluginRepository>
and not also declared as a project <repository> failed to resolve
there even though Maven resolved and ran the plugin fine during a
normal build.

Added a resolveArtifact(artifact, repositories) overload taking an
explicit repository list, with the existing resolveArtifact(artifact)
delegating to it with project repositories unchanged for its other
callers (getMavenProject, EvaluateMojo). DescribeMojo's three
plugin-resolution call sites now pass
project.getRemotePluginRepositories().
@slachiewicz slachiewicz added the bug Something isn't working label Oct 29, 2026
@slawekjaranowski
slawekjaranowski merged commit 57b496f into apache:master Nov 9, 2026
19 checks passed
@github-actions github-actions Bot added this to the 3.5.3 milestone Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MPH-204] Use pluginRepositories not repositories

3 participants