Skip to content

GH-938: Revert offloading project dependency resolution#939

Merged
ascopes merged 5 commits into
mainfrom
task/GH-938-revert-offloading-resolution
Mar 1, 2026
Merged

GH-938: Revert offloading project dependency resolution#939
ascopes merged 5 commits into
mainfrom
task/GH-938-revert-offloading-resolution

Conversation

@ascopes

@ascopes ascopes commented Feb 27, 2026

Copy link
Copy Markdown
Owner

Changes the project dependency resolution to remove a hard requirement on resolving the project dependencies before plugin execution, which can cause some issues with the project reactor being incomplete as mentioned in GH-938. This change at least allows users to opt out of project dependency resolution entirely using the attribute.

We may need to keep an eye that GH-596 does not manifest itself again though, as this was creating heap exhaustion failures for some users, although I was never able to fully reproduce this on my side when this was last reported. It may still be a red herring. GH-596 did re-manifest itself in this change but additional changes to the default dependency traverser have been made that appear to address the original problem. This seems to be related to transitive test dependencies or fat dependencies being traversed when they should be treated as terminal dependencies, just like Maven does internally.

Fixes GH-938

@ascopes ascopes self-assigned this Feb 27, 2026
@ascopes ascopes added bug Something isn't working chore General tech debt work. labels Feb 27, 2026
@codecov

codecov Bot commented Feb 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.73%. Comparing base (7edc8de) to head (cb6902b).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #939      +/-   ##
==========================================
- Coverage   92.89%   92.73%   -0.15%     
==========================================
  Files          71       71              
  Lines        2010     2008       -2     
  Branches      132      131       -1     
==========================================
- Hits         1867     1862       -5     
- Misses        103      108       +5     
+ Partials       40       38       -2     
Flag Coverage Δ
maven-3.9.12-java-17-macos-15 90.94% <100.00%> (-0.15%) ⬇️
maven-3.9.12-java-17-ubuntu-24.04 91.99% <100.00%> (-0.15%) ⬇️
maven-3.9.12-java-17-ubuntu-24.04-arm 90.94% <100.00%> (-0.15%) ⬇️
maven-3.9.12-java-17-windows-2025 90.04% <100.00%> (-0.15%) ⬇️
maven-3.9.12-java-21-ubuntu-24.04 91.99% <100.00%> (-0.15%) ⬇️
maven-3.9.12-java-21-windows-11-arm 90.04% <100.00%> (-0.15%) ⬇️
maven-3.9.12-java-25-ubuntu-24.04 91.99% <100.00%> (-0.15%) ⬇️
maven-3.9.6-java-17-ubuntu-24.04 91.99% <100.00%> (-0.15%) ⬇️
maven-4.0.0-rc-5-java-17-ubuntu-24.04 91.99% <100.00%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ugin/dependencies/aether/AetherArtifactMapper.java 100.00% <100.00%> (ø)
...ependencies/aether/AetherDependencyManagement.java 85.00% <100.00%> (-7.50%) ⬇️
...encies/aether/AetherMavenArtifactPathResolver.java 95.66% <100.00%> (+0.10%) ⬆️
...avenplugin/dependencies/aether/AetherResolver.java 69.24% <ø> (ø)
...s/aether/ProtobufMavenPluginRepositorySession.java 100.00% <100.00%> (ø)
...ncies/aether/WildcardAwareDependencyTraverser.java 100.00% <100.00%> (ø)
...pes/protobufmavenplugin/mojo/MainGenerateMojo.java 100.00% <ø> (ø)
...pes/protobufmavenplugin/mojo/TestGenerateMojo.java 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ascopes ascopes marked this pull request as ready for review February 27, 2026 20:56
@ascopes ascopes force-pushed the task/GH-938-revert-offloading-resolution branch from 68e71bc to 7ce7c59 Compare March 1, 2026 14:55
ascopes added 5 commits March 1, 2026 19:36
Changes the project dependency resolution to remove a hard requirement
on resolving the project dependencies before plugin execution, which
can cause some issues with the project reactor being incomplete
as mentioned in GH-938. This change at least allows users to opt out
of project dependency resolution entirely using the
<includeProjectDependences/> attribute.

We may need to keep an eye that GH-596 does not manifest itself
again though, as this was creating heap exhaustion failures for some
users, although I was never able to fully reproduce this on my side
when this was last reported. It may still be a red herring.
Integrate some additional traversers Maven appears to use under
the hood to reduce the risk of heap memory exhaustion. Seems to
relate to avoiding recursive traversal of fat artifacts that should
be considered flat, as well as avoiding test dependencies that are
transitively available.
@ascopes ascopes force-pushed the task/GH-938-revert-offloading-resolution branch from 7ce7c59 to cb6902b Compare March 1, 2026 19:36
@ascopes ascopes merged commit dd18224 into main Mar 1, 2026
14 of 15 checks passed
@ascopes ascopes deleted the task/GH-938-revert-offloading-resolution branch March 1, 2026 20:09
ascopes added a commit that referenced this pull request Mar 2, 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 chore General tech debt work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Breaking generate-sources in multi-module projects due to requiresDependencyResolution = ResolutionScope.TEST

1 participant