mirror of https://github.com/apache/maven.git
parent
29e7b0ea3c
commit
968c1a25f5
|
@ -194,8 +194,11 @@ public class DefaultArtifactDescriptorReader implements ArtifactDescriptorReader
|
|||
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,
|
||||
|
@ -248,9 +251,14 @@ public class DefaultArtifactDescriptorReader implements ArtifactDescriptorReader
|
|||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue