Skip to content
New issue

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

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

Already on GitHub? # to your account

[MNG-7634] Revert MNG-5982 and MNG-7417 (Maven 3.9.x) #917

Merged
merged 1 commit into from
Dec 20, 2022
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 @@ -253,8 +253,11 @@ private Model loadPom(
modelRequest.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);
modelRequest.setProcessPlugins(false);
modelRequest.setTwoPhaseBuilding(false);
modelRequest.setSystemProperties(toProperties(session.getSystemProperties()));
modelRequest.setUserProperties(toProperties(session.getUserProperties()));
// This merge is on purpose because otherwise user properties would override model
// properties in dependencies the user does not know. See MNG-7563 for details.
modelRequest.setSystemProperties(
toProperties(session.getUserProperties(), session.getSystemProperties()));
modelRequest.setUserProperties(new Properties());
modelRequest.setModelCache(modelCacheFactory.createCache(session));
modelRequest.setModelResolver(new DefaultModelResolver(
session,
Expand Down Expand Up @@ -303,9 +306,14 @@ private Model loadPom(
}
}

private Properties toProperties(Map<String, String> map) {
private Properties toProperties(Map<String, String> dominant, Map<String, String> recessive) {
Properties props = new Properties();
props.putAll(map);
if (recessive != null) {
props.putAll(recessive);
}
if (dominant != null) {
props.putAll(dominant);
}
return props;
}

Expand Down