-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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-7974] Update Resolver 2.0.0-alpha-5 #1337
Conversation
(to be in alpha-4) In short, this opens the gate to use different version schemes per Maven session. --- https://issues.apache.org/jira/browse/MNG-7950 https://issues.apache.org/jira/browse/MNG-7951
...core/src/main/java/org/apache/maven/plugin/internal/MavenPluginMavenPrerequisiteChecker.java
Outdated
Show resolved
Hide resolved
What about all the usages of |
This is legacy way, make it proper
I'm not sure I'm buying the use of the additional indirection for the |
The goal of this PR is to allow transparently per-session choice of Also, don't forget that this allows now for a Mojo to customize session (and configure version scheme for use case) and then perform different queries against resolver... VersionScheme is a resolver interface, and while Resolver does not instantiate it anywhere directly, it is always client code that needs to set it (ie. see util filters etc), but as this PR shows, there are some resolver component implementations (am looking at maven-resolver-provider) that use it. Hence, this PR makes this feature available for Maven but also for any Resolver 3rd party integration as well. Reason why would you use different Finally, don't forget that currently regarding versions there are two "parallel universes" (both with own bugs), the maven-artifact Version and resolver Generic version scheme. This could also open a gate to drop one of them, and have two implementations of Scheme like "generic" and "legacy", that implements old one with all of it's bugs, hence users could choose "modus operandi", "current" or "legacy". |
Reworked PR: stepped off selector, it was reverted (see https://issues.apache.org/jira/browse/MRESOLVER-457 and read why it was bad idea). All simpler now. |
I agree with 49cec29 commit: if component changed to session scope, no need for provider. Can you explain that? As your 2nd commit makes mandatory to rebuild component graph in case of schema change, while with provider it was possible without doing that. |
So what kind of schema change do you have in mind exactly ? I'm not buying the idea to use Provider at the injection point to control the lifecycle of dependent beans. If we suppose a plugin can register any kind of component and that it should override the default component set, then all injection points have to use Provider. Such components are supposed to be provided by extensions, which do not change. Fwiw, I think we do overuse the |
Ok, let's postpone this discussion, am completely fine if this PR merely upgrades Resolver to alpha-5. My ultimate goal is to kill off "parallel universe" (two version implementations, resolver and maven), but for sure this PR is not fixing that. And agree with overuse of singletons as well. Let's move on with this if you are fine with it. |
...core/src/test/java/org/apache/maven/internal/transformation/impl/ConsumerPomBuilderTest.java
Outdated
Show resolved
Hide resolved
Not needed anymore
@gnodet this PR became "just" update to resolver-5 w/ cleanup. So please review it as such. |
Update to Resolver alpha-5 and apply some cleanups.
Notable changes:
https://issues.apache.org/jira/browse/MNG-7974