[MNG-4913] [regression] User properties override equally named POM properties of transitive dependencies

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1038391 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-11-24 00:04:21 +00:00
parent 1322272d6b
commit 4a83a69436
1 changed files with 9 additions and 5 deletions

View File

@ -282,8 +282,8 @@ public class DefaultArtifactDescriptorReader
modelRequest.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL ); modelRequest.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
modelRequest.setProcessPlugins( false ); modelRequest.setProcessPlugins( false );
modelRequest.setTwoPhaseBuilding( false ); modelRequest.setTwoPhaseBuilding( false );
modelRequest.setSystemProperties( toProperties( session.getSystemProperties() ) ); modelRequest.setSystemProperties( toProperties( session.getUserProperties(),
modelRequest.setUserProperties( toProperties( session.getUserProperties() ) ); session.getSystemProperties() ) );
modelRequest.setModelCache( DefaultModelCache.newInstance( session ) ); modelRequest.setModelCache( DefaultModelCache.newInstance( session ) );
modelRequest.setModelResolver( new DefaultModelResolver( session, request.getRequestContext(), modelRequest.setModelResolver( new DefaultModelResolver( session, request.getRequestContext(),
artifactResolver, remoteRepositoryManager, artifactResolver, remoteRepositoryManager,
@ -335,12 +335,16 @@ public class DefaultArtifactDescriptorReader
} }
} }
private Properties toProperties( Map<String, String> map ) private Properties toProperties( Map<String, String> dominant, Map<String, String> recessive )
{ {
Properties props = new Properties(); Properties props = new Properties();
if ( map != null ) if ( recessive != null )
{ {
props.putAll( map ); props.putAll( recessive );
}
if ( dominant != null )
{
props.putAll( dominant );
} }
return props; return props;
} }