Skip to content

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
@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

@gnodet
Copy link
Contributor

gnodet commented Jan 9, 2025

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

The fix was implemented in b7088a3 AFAIK. This may be something slightly different.

@jira-importer
Copy link

Resolve #9404

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.

3 participants