feat(maven-use): handle indirect plugin dependencies
Metadata
Current evaluation
Merged changes fix Maven indirect plugin dependency handling by scanning available plugins on disk and adding explicit pins via pluginManagement, replacing hard-coded default versions. Approved by three reviewers with all CI checks passing.
Suggested action: —
No scores available.
Issue body
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you added an entry to the changelog (`docs/reference/changelog.rst`)?
-----
When a project indirectly depended on a plugin (e.g. the very common implicit dependency on Maven's "jar" plugin), Maven would use an internal hard-coded list of default version numbers to select what version to use, even if that version was not present.
This PR changes the maven-use plugin to scan for all available Maven plugins on disk and add an explicit pin for every available plugin using `pluginManagement`, `pom.xml`'s equivalent to pip constraints.
The main steps taken for this were:
- Change the mapping of available Maven dependencies on-disk to also include the "packaging type" of each, which reveals if it is a plugin or not
- Keep track of what plugins were an explicit dependency
- For every plugin that was not an explicit dependency, but is found on disk, a `pluginManagement` entry is added instead
- The integration test had the workaround for this bug removed in every file but one, which was kept to show either behavior works
CRAFT-4590.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged changes fix Maven indirect plugin dependency handling by scanning available plugins on disk and adding explicit pins via pluginManagement, replacing hard-coded default versions. Approved by three reviewers with all CI checks passing. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Resolves CRAFT-4590 by updating the maven-use plugin to scan for available Maven plugins on disk and explicitly pin indirect dependencies via pluginManagement, replacing hardcoded default version selection. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1163 feat(maven-use): consume binaries directly | craft-parts | merged | Merged a squashed commit enabling the maven-use plugin to directly consume pre-built Maven artifacts as sources when a maven-use directory exists. Approved by three reviewers, passed all CI checks, and includes integration tests. | |
| #1166 feat(maven-use): support multi-module projects | craft-parts | merged | Merged. Implements recursive discovery and patching for nested pom.xml files in multi-module Maven projects via the maven-use plugin. Approved by three reviewers, passed all CI checks, and modified 11 files. | |
| #1154 feat: allow customizations on MavenPlugin | craft-parts | merged | Merged feature adding customization points to MavenPlugin, allowing subclasses to run extra operations and deploy to custom paths without changing default behavior. Approved by three reviewers and passed all CI checks. | |
| #3179 Maven plugin: improve error message when target libs are not found. | snapcraft | merged | Merged updates to the Maven plugin that enhance error reporting for missing target libraries. The change adds searched directories and a usage scenario to clarify build failures. Approved by one reviewer and passed CI checks. | |
| #1215 feat(maven-use): improve selection when rewriting version numbers | craft-parts | merged | Merged improvement to Maven version selection logic during rewrites. Approved by three reviewers and passed all CI checks. Adds full test coverage and documents edge cases across five files to handle arbitrary strings. |