{
DefaultModelBuildingResult result = new DefaultModelBuildingResult();
DefaultModelProblemCollector problems = new DefaultModelProblemCollector( null );
ProfileActivationContext profileActivationContext = getProfileActivationContext( request );
problems.setSource( "(external profiles)" );
List<Profile> activeExternalProfiles =
profileSelector.getActiveProfiles( request.getProfiles(), profileActivationContext, problems );
if ( !activeExternalProfiles.isEmpty() )
{
Properties profileProps = new Properties();
for ( Profile profile : activeExternalProfiles )
{
profileProps.putAll( profile.getProperties() );
}
profileProps.putAll( profileActivationContext.getUserProperties() );
profileActivationContext.setUserProperties( profileProps );
}
Model inputModel = readModel( request.getModelSource(), request.getPomFile(), request, problems );
problems.setRootModel( inputModel );