Repository navigation
Fix #326: resolve a described plugin against plugin repositories - #453
Merged
slawekjaranowski merged 1 commit intoNov 9, 2026
Merged
slawekjaranowski merged 1 commit into
slawekjaranowski merged 1 commit into
Conversation
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().
slawekjaranowski
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: