if ( projectDescriptor != null )
{
projectDir = projectDescriptor.getAbsoluteFile().getParentFile();
}
ProfileManager externalProfileManager = config.getGlobalProfileManager();
ProfileManager profileManager;
if ( externalProfileManager != null )
{
profileManager = new DefaultProfileManager( container, externalProfileManager.getRequestProperties() );
}
else
{
//TODO mkleint - use the (Container, Properties constructor to make system properties embeddable
profileManager = new DefaultProfileManager( container );
}
if ( externalProfileManager != null )
{
profileManager.explicitlyActivate( externalProfileManager.getExplicitlyActivatedIds() );
profileManager.explicitlyDeactivate( externalProfileManager.getExplicitlyDeactivatedIds() );
}
List activeProfiles;
try
{
profileManager.addProfiles( model.getProfiles() );
loadProjectExternalProfiles( profileManager, projectDir );
activeProfiles = injectActiveProfiles( profileManager, model );
}