mirror of https://github.com/apache/maven.git
Detangled profile activitation dependency on realm manager. Move org.apache.maven.realm package to maven-core project.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@695332 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
180bf37d84
commit
bc3660ec47
|
@ -742,7 +742,7 @@ public class DefaultMavenExecutionRequestPopulator
|
|||
ProfileActivationContext activationContext = request.getProfileActivationContext();
|
||||
if ( activationContext == null )
|
||||
{
|
||||
activationContext = new DefaultProfileActivationContext( request.getRealmManager(),
|
||||
activationContext = new DefaultProfileActivationContext(
|
||||
request.getProperties(), false );
|
||||
}
|
||||
|
||||
|
|
|
@ -27,13 +27,9 @@ import org.apache.maven.profiles.activation.DefaultProfileActivationContext;
|
|||
import org.apache.maven.profiles.activation.ProfileActivationContext;
|
||||
import org.apache.maven.profiles.activation.ProfileActivationException;
|
||||
import org.apache.maven.profiles.activation.ProfileActivator;
|
||||
import org.apache.maven.realm.DefaultMavenRealmManager;
|
||||
import org.apache.maven.realm.MavenRealmManager;
|
||||
import org.codehaus.plexus.PlexusContainer;
|
||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
|
||||
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
@ -81,11 +77,8 @@ public class DefaultProfileManager
|
|||
|
||||
private ProfileActivationContext createDefaultActivationContext()
|
||||
{
|
||||
// create the necessary bits to get a skeletal profile manager running.
|
||||
Logger logger = container.getLoggerManager().getLoggerForComponent( DefaultProfileManager.class.getName() );
|
||||
MavenRealmManager manager = new DefaultMavenRealmManager( container, logger );
|
||||
|
||||
return new DefaultProfileActivationContext( manager, System.getProperties(), false );
|
||||
return new DefaultProfileActivationContext(System.getProperties(), false );
|
||||
}
|
||||
|
||||
public ProfileActivationContext getProfileActivationContext()
|
||||
|
@ -190,17 +183,6 @@ public class DefaultProfileManager
|
|||
public List getActiveProfiles( Model model )
|
||||
throws ProfileActivationException
|
||||
{
|
||||
MavenRealmManager realmManager = profileActivationContext.getRealmManager();
|
||||
|
||||
ClassRealm projectRealm = null;
|
||||
ClassRealm oldLookupRealm = null;
|
||||
|
||||
if ( ( model != null ) && ( realmManager != null ) )
|
||||
{
|
||||
projectRealm = realmManager.getProjectRealm( getGroupId( model ), model.getArtifactId(),
|
||||
getVersion( model ) );
|
||||
oldLookupRealm = container.setLookupRealm( projectRealm );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -271,10 +253,6 @@ public class DefaultProfileManager
|
|||
}
|
||||
finally
|
||||
{
|
||||
if ( projectRealm != null )
|
||||
{
|
||||
container.setLookupRealm( oldLookupRealm );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.profiles.activation;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.realm.MavenRealmManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
@ -38,21 +37,10 @@ public class DefaultProfileActivationContext
|
|||
|
||||
List explicitlyInactive;
|
||||
|
||||
private final MavenRealmManager realmManager;
|
||||
|
||||
private List activeByDefault;
|
||||
|
||||
public DefaultProfileActivationContext( MavenRealmManager realmManager, Properties executionProperties,
|
||||
boolean isCustomActivatorFailureSuppressed )
|
||||
{
|
||||
this.realmManager = realmManager;
|
||||
this.executionProperties = executionProperties;
|
||||
this.isCustomActivatorFailureSuppressed = isCustomActivatorFailureSuppressed;
|
||||
}
|
||||
|
||||
public DefaultProfileActivationContext( Properties executionProperties, boolean isCustomActivatorFailureSuppressed )
|
||||
{
|
||||
realmManager = null;
|
||||
this.executionProperties = executionProperties;
|
||||
this.isCustomActivatorFailureSuppressed = isCustomActivatorFailureSuppressed;
|
||||
}
|
||||
|
@ -102,11 +90,6 @@ public class DefaultProfileActivationContext
|
|||
explicitlyInactive = inactive;
|
||||
}
|
||||
|
||||
public MavenRealmManager getRealmManager()
|
||||
{
|
||||
return realmManager;
|
||||
}
|
||||
|
||||
public void setActive( String profileId )
|
||||
{
|
||||
if ( explicitlyActive == null )
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.profiles.activation;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.realm.MavenRealmManager;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
@ -31,8 +30,6 @@ public interface ProfileActivationContext
|
|||
|
||||
List getExplicitlyInactiveProfileIds();
|
||||
|
||||
MavenRealmManager getRealmManager();
|
||||
|
||||
Properties getExecutionProperties();
|
||||
|
||||
boolean isCustomActivatorFailureSuppressed();
|
||||
|
|
Loading…
Reference in New Issue