Skip to content

Commit

Permalink
[MNG-7634] Revert MNG-5982 and MNG-7417
Browse files Browse the repository at this point in the history
This closes #917
  • Loading branch information
michael-o committed Dec 20, 2022
1 parent 61f1f01 commit 7db942b
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,11 @@ private Model loadPom( RepositorySystemSession session, ArtifactDescriptorReques
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( DefaultModelCache.newInstance( session ) );
modelRequest.setModelResolver( new DefaultModelResolver( session, trace.newChild( modelRequest ),
request.getRequestContext(), artifactResolver,
Expand Down Expand Up @@ -328,10 +331,17 @@ private Model loadPom( RepositorySystemSession session, ArtifactDescriptorReques
}
}

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

0 comments on commit 7db942b

Please sign in to comment.