mirror of https://github.com/apache/maven.git
Removed deprecated methods and uses of ProfileManager.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@748893 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b487a2fd45
commit
aaf67164e0
|
@ -129,66 +129,6 @@ public class DefaultProfileManager
|
|||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.maven.project.ProfileManager#explicitlyActivate(java.lang.String)
|
||||
*/
|
||||
public void explicitlyActivate( String profileId )
|
||||
{
|
||||
List activatedIds = profileActivationContext.getExplicitlyActiveProfileIds();
|
||||
if ( !activatedIds.contains( profileId ) )
|
||||
{
|
||||
container.getLogger().debug( "Profile with id: \'" + profileId + "\' has been explicitly activated." );
|
||||
|
||||
profileActivationContext.setActive( profileId );
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.maven.project.ProfileManager#explicitlyActivate(java.util.List)
|
||||
*/
|
||||
public void explicitlyActivate( List profileIds )
|
||||
{
|
||||
for ( Iterator it = profileIds.iterator(); it.hasNext(); )
|
||||
{
|
||||
String profileId = (String) it.next();
|
||||
|
||||
explicitlyActivate( profileId );
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.maven.project.ProfileManager#explicitlyDeactivate(java.lang.String)
|
||||
*/
|
||||
public void explicitlyDeactivate( String profileId )
|
||||
{
|
||||
List deactivatedIds = profileActivationContext.getExplicitlyInactiveProfileIds();
|
||||
if ( !deactivatedIds.contains( profileId ) )
|
||||
{
|
||||
container.getLogger().debug( "Profile with id: \'" + profileId + "\' has been explicitly deactivated." );
|
||||
|
||||
profileActivationContext.setInactive( profileId );
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.maven.project.ProfileManager#explicitlyDeactivate(java.util.List)
|
||||
*/
|
||||
public void explicitlyDeactivate( List profileIds )
|
||||
{
|
||||
for ( Iterator it = profileIds.iterator(); it.hasNext(); )
|
||||
{
|
||||
String profileId = (String) it.next();
|
||||
|
||||
explicitlyDeactivate( profileId );
|
||||
}
|
||||
}
|
||||
|
||||
public List getActiveProfiles()
|
||||
throws ProfileActivationException
|
||||
{
|
||||
return getActiveProfiles( null );
|
||||
}
|
||||
|
||||
// TODO: Portions of this logic are duplicated in o.a.m.p.b.p.ProfileContext, something is wrong here
|
||||
public List getActiveProfiles( Model model )
|
||||
throws ProfileActivationException
|
||||
|
@ -344,7 +284,7 @@ public class DefaultProfileManager
|
|||
/* (non-Javadoc)
|
||||
* @see org.apache.maven.project.ProfileManager#addProfiles(java.util.List)
|
||||
*/
|
||||
public void addProfiles( List profiles )
|
||||
public void addProfiles( List<Profile> profiles )
|
||||
{
|
||||
for ( Iterator it = profiles.iterator(); it.hasNext(); )
|
||||
{
|
||||
|
@ -354,7 +294,7 @@ public class DefaultProfileManager
|
|||
}
|
||||
}
|
||||
|
||||
public void activateAsDefault( String profileId )
|
||||
private void activateAsDefault( String profileId )
|
||||
{
|
||||
List defaultIds = profileActivationContext.getActiveByDefaultProfileIds();
|
||||
|
||||
|
@ -364,21 +304,6 @@ public class DefaultProfileManager
|
|||
}
|
||||
}
|
||||
|
||||
public List getExplicitlyActivatedIds()
|
||||
{
|
||||
return profileActivationContext.getExplicitlyActiveProfileIds();
|
||||
}
|
||||
|
||||
public List getExplicitlyDeactivatedIds()
|
||||
{
|
||||
return profileActivationContext.getExplicitlyInactiveProfileIds();
|
||||
}
|
||||
|
||||
public List getIdsActivatedByDefault()
|
||||
{
|
||||
return profileActivationContext.getActiveByDefaultProfileIds();
|
||||
}
|
||||
|
||||
|
||||
public static String getGroupId( Model model )
|
||||
{
|
||||
|
|
|
@ -31,60 +31,14 @@ public interface ProfileManager
|
|||
{
|
||||
void addProfile( Profile profile );
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ProfileActivationContext} methods instead.
|
||||
*/
|
||||
void explicitlyActivate( String profileId );
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ProfileActivationContext} methods instead.
|
||||
*/
|
||||
void explicitlyActivate( List profileIds );
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ProfileActivationContext} methods instead.
|
||||
*/
|
||||
void explicitlyDeactivate( String profileId );
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ProfileActivationContext} methods instead.
|
||||
*/
|
||||
void explicitlyDeactivate( List profileIds );
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ProfileActivationContext} methods instead.
|
||||
*/
|
||||
void activateAsDefault( String profileId );
|
||||
|
||||
ProfileActivationContext getProfileActivationContext();
|
||||
|
||||
void setProfileActivationContext( ProfileActivationContext profileActivationContext );
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ProfileManager#getActiveProfiles(Model)} instead.
|
||||
*/
|
||||
List getActiveProfiles()
|
||||
throws ProfileActivationException;
|
||||
|
||||
void addProfiles( List profiles );
|
||||
void addProfiles( List<Profile> profiles );
|
||||
|
||||
Map getProfilesById();
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ProfileActivationContext} methods instead.
|
||||
*/
|
||||
List getExplicitlyActivatedIds();
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ProfileActivationContext} methods instead.
|
||||
*/
|
||||
List getExplicitlyDeactivatedIds();
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ProfileActivationContext} methods instead.
|
||||
*/
|
||||
List getIdsActivatedByDefault();
|
||||
|
||||
List getActiveProfiles( Model model )
|
||||
throws ProfileActivationException;
|
||||
}
|
|
@ -70,7 +70,7 @@ public class DefaultProfileManagerTest
|
|||
profileManager.addProfile( notActivated );
|
||||
profileManager.addProfile( defaultActivated );
|
||||
|
||||
List active = profileManager.getActiveProfiles();
|
||||
List active = profileManager.getActiveProfiles( null );
|
||||
|
||||
assertNotNull( active );
|
||||
assertEquals( 1, active.size() );
|
||||
|
@ -109,7 +109,7 @@ public class DefaultProfileManagerTest
|
|||
profileManager.addProfile( syspropActivated );
|
||||
profileManager.addProfile( defaultActivated );
|
||||
|
||||
List active = profileManager.getActiveProfiles();
|
||||
List active = profileManager.getActiveProfiles( null );
|
||||
|
||||
assertNotNull( active );
|
||||
assertEquals( 1, active.size() );
|
||||
|
@ -138,7 +138,7 @@ public class DefaultProfileManagerTest
|
|||
|
||||
profileManager.addProfile( syspropActivated );
|
||||
|
||||
List active = profileManager.getActiveProfiles();
|
||||
List active = profileManager.getActiveProfiles( null );
|
||||
|
||||
assertNotNull( active );
|
||||
assertEquals( 0, active.size() );
|
||||
|
@ -166,9 +166,9 @@ public class DefaultProfileManagerTest
|
|||
|
||||
profileManager.addProfile( syspropActivated );
|
||||
|
||||
profileManager.explicitlyActivate( "syspropActivated" );
|
||||
ctx.setActive( "syspropActivated" );
|
||||
|
||||
List active = profileManager.getActiveProfiles();
|
||||
List active = profileManager.getActiveProfiles( null );
|
||||
|
||||
assertNotNull( active );
|
||||
assertEquals( 1, active.size() );
|
||||
|
@ -197,9 +197,9 @@ public class DefaultProfileManagerTest
|
|||
|
||||
profileManager.addProfile( syspropActivated );
|
||||
|
||||
profileManager.explicitlyDeactivate( "syspropActivated" );
|
||||
ctx.setInactive( "syspropActivated" );
|
||||
|
||||
List active = profileManager.getActiveProfiles();
|
||||
List active = profileManager.getActiveProfiles( null );
|
||||
|
||||
assertNotNull( active );
|
||||
assertEquals( 0, active.size() );
|
||||
|
@ -228,7 +228,7 @@ public class DefaultProfileManagerTest
|
|||
|
||||
profileManager.addProfile( osActivated );
|
||||
|
||||
List active = profileManager.getActiveProfiles();
|
||||
List active = profileManager.getActiveProfiles( null );
|
||||
|
||||
assertNotNull( active );
|
||||
assertEquals( 1, active.size() );
|
||||
|
|
Loading…
Reference in New Issue