Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-8451] Core inject depMgt for plugin resolution #2000

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Dec 19, 2024

Maven Core injects "own provided" artifacts when resolving plugins, instead to let the resolve and then just leave out from the classpath, this makes much less downloads happening.

Example of effects of this PR: Rebuilding Maven master with empty local repository, and after the build:

  • w/ master maven local repository 216MB / 3188 files
  • w/ this PR maven local repository 209MB / 2864 files

(this PR basically makes unnecessary to set "maven core dependencies to provided" anymore, as it will NOT download those unused versions, given core is providing itself instead)

Note: Maven master sports "quite fresh" (and aligned) plugins, and almost all are fixed re "provided" scope, hence this difference is not big, but it would be much more visible on some build using "higher range" of non aligned plugins.


https://issues.apache.org/jira/browse/MNG-8451

@cstamas cstamas requested a review from gnodet December 19, 2024 12:08
@cstamas cstamas self-assigned this Dec 19, 2024
There is a change (but in implementation only!) that
prevents japicmp to load up (impl) classes: ignore those,
we are really interested in API only.
@cstamas
Copy link
Member Author

cstamas commented Dec 19, 2024

This works cool, but breaks https://issues.apache.org/jira/browse/MNG-5783
We need to implement the proposed fix in refd issue.

.setVersion(managedDep.getArtifact().getVersion()));
}
// align scope
pluginDep = pluginDep.setScope(managedDep.getScope());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we flag them as system scope ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... to avoid downloading the jars ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but there is more to this PR, it breaks https://issues.apache.org/jira/browse/MNG-5783 We need to implement the proposed fix in refd issue (real classpath vs ${plugin.artifacts}).

Copy link
Member Author

@cstamas cstamas Dec 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Former contains plugin stuff + maven core imported (as one), while latter should contain all JARs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants