mirror of https://github.com/apache/maven.git
o decoupled Settings from the profile manager
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@573436 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a698b7ef49
commit
c8ab5fb076
|
@ -128,7 +128,7 @@ public class DefaultProfileAdvisor
|
|||
List explicitlyInactiveIds )
|
||||
throws ProjectBuildingException
|
||||
{
|
||||
ProfileManager profileManager = new DefaultProfileManager( container, new Properties() );
|
||||
ProfileManager profileManager = new DefaultProfileManager( container );
|
||||
|
||||
profileManager.explicitlyActivate( explicitlyActiveIds );
|
||||
profileManager.explicitlyDeactivate( explicitlyInactiveIds );
|
||||
|
|
|
@ -23,8 +23,6 @@ import org.apache.maven.model.Activation;
|
|||
import org.apache.maven.model.Profile;
|
||||
import org.apache.maven.profiles.activation.ProfileActivationException;
|
||||
import org.apache.maven.profiles.activation.ProfileActivator;
|
||||
import org.apache.maven.settings.Settings;
|
||||
import org.apache.maven.settings.SettingsUtils;
|
||||
import org.codehaus.plexus.PlexusContainer;
|
||||
import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
|
||||
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
||||
|
@ -55,33 +53,9 @@ public class DefaultProfileManager
|
|||
* are passed to maven, possibly containing profile activator properties
|
||||
*
|
||||
*/
|
||||
public DefaultProfileManager( PlexusContainer container, Properties props )
|
||||
{
|
||||
this( container, null, props );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated without passing in the system properties, the SystemPropertiesProfileActivator will not work correctly
|
||||
* in embedded envirnments.
|
||||
*/
|
||||
public DefaultProfileManager( PlexusContainer container, Settings settings )
|
||||
public DefaultProfileManager( PlexusContainer container )
|
||||
{
|
||||
this.container = container;
|
||||
|
||||
loadSettingsProfiles( settings );
|
||||
}
|
||||
|
||||
/**
|
||||
* the properties passed to the profile manager are the props that
|
||||
* are passed to maven, possibly containing profile activator properties
|
||||
*
|
||||
*/
|
||||
public DefaultProfileManager( PlexusContainer container, Settings settings, Properties props )
|
||||
{
|
||||
this.container = container;
|
||||
|
||||
loadSettingsProfiles( settings );
|
||||
}
|
||||
|
||||
public Map getProfilesById()
|
||||
|
@ -308,30 +282,4 @@ public class DefaultProfileManager
|
|||
{
|
||||
return defaultIds;
|
||||
}
|
||||
|
||||
public void loadSettingsProfiles( Settings settings )
|
||||
{
|
||||
if ( settings == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List settingsProfiles = settings.getProfiles();
|
||||
|
||||
if ( settingsProfiles != null && !settingsProfiles.isEmpty() )
|
||||
{
|
||||
List settingsActiveProfileIds = settings.getActiveProfiles();
|
||||
|
||||
explicitlyActivate( settingsActiveProfileIds );
|
||||
|
||||
for ( Iterator it = settings.getProfiles().iterator(); it.hasNext(); )
|
||||
{
|
||||
org.apache.maven.settings.Profile rawProfile = (org.apache.maven.settings.Profile) it.next();
|
||||
|
||||
Profile profile = SettingsUtils.convertFromSettingsProfile( rawProfile );
|
||||
|
||||
addProfile( profile );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,8 +51,5 @@ public interface ProfileManager
|
|||
|
||||
List getExplicitlyDeactivatedIds();
|
||||
|
||||
List getIdsActivatedByDefault();
|
||||
|
||||
void loadSettingsProfiles( Settings settings );
|
||||
|
||||
List getIdsActivatedByDefault();
|
||||
}
|
Loading…
Reference in New Issue