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

[3.9.x][MNG-7608] Make native transport the default #961

Merged
merged 1 commit into from
Jan 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -324,23 +324,7 @@ public DefaultRepositorySystemSession newRepositorySession(MavenExecutionRequest

Object transport = configProps.getOrDefault(MAVEN_RESOLVER_TRANSPORT_KEY, MAVEN_RESOLVER_TRANSPORT_DEFAULT);
if (MAVEN_RESOLVER_TRANSPORT_DEFAULT.equals(transport)) {
// The "default" mode (user did not set anything) needs to tweak resolver default priorities
// that are coded like this (default values):
//
// org.eclipse.aether.transport.http.HttpTransporterFactory.priority = 5.0f;
// org.eclipse.aether.transport.wagon.WagonTransporterFactory.priority = -1.0f;
//
// Hence, as both are present on classpath, HttpTransport would be selected, while
// we want to retain "default" behaviour of Maven and use Wagon. To achieve that,
// we set explicitly priority of WagonTransport to 6.0f (just above of HttpTransport),
// to make it "win" over HttpTransport. We do this to NOT interfere with possibly
// installed OTHER transports and their priorities, as unlike "wagon" or "native"
// transport setting, that sets priorities to MAX, hence prevents any 3rd party
// transport to get into play (inhibits them), in default mode we want to retain
// old behavior. Also, this "default" mode is different from "auto" setting,
// as it does not alter resolver priorities at all, and uses priorities as is.

configProps.put(WAGON_TRANSPORTER_PRIORITY_KEY, "6");
// The "default" mode (user did not set anything) from now on defaults to AUTO
} else if (MAVEN_RESOLVER_TRANSPORT_NATIVE.equals(transport)) {
// Make sure (whatever extra priority is set) that resolver native is selected
configProps.put(NATIVE_FILE_TRANSPORTER_PRIORITY_KEY, RESOLVER_MAX_PRIORITY);
Expand Down