Package org.apache.maven.model.profile
Class DefaultProfileActivationContext
- java.lang.Object
-
- org.apache.maven.model.profile.DefaultProfileActivationContext
-
- All Implemented Interfaces:
ProfileActivationContext
public class DefaultProfileActivationContext extends java.lang.Object implements ProfileActivationContext
Describes the environmental context used to determine the activation status of profiles.- Author:
- Benjamin Bentmann
-
-
Field Summary
-
Fields inherited from interface org.apache.maven.model.profile.ProfileActivationContext
PROPERTY_NAME_PACKAGING
-
-
Constructor Summary
Constructors Constructor Description DefaultProfileActivationContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>getActiveProfileIds()Gets the identifiers of those profiles that should be activated by explicit demand.java.util.List<java.lang.String>getInactiveProfileIds()Gets the identifiers of those profiles that should be deactivated by explicit demand.java.io.FilegetProjectDirectory()Gets the base directory of the current project (if any).java.util.Map<java.lang.String,java.lang.String>getProjectProperties()Gets current calculated project propertiesjava.util.Map<java.lang.String,java.lang.String>getSystemProperties()Gets the system properties to use for interpolation and profile activation.java.util.Map<java.lang.String,java.lang.String>getUserProperties()Gets the user properties to use for interpolation and profile activation.DefaultProfileActivationContextsetActiveProfileIds(java.util.List<java.lang.String> activeProfileIds)Sets the identifiers of those profiles that should be activated by explicit demand.DefaultProfileActivationContextsetInactiveProfileIds(java.util.List<java.lang.String> inactiveProfileIds)Sets the identifiers of those profiles that should be deactivated by explicit demand.DefaultProfileActivationContextsetProjectDirectory(java.io.File projectDirectory)Sets the base directory of the current project.DefaultProfileActivationContextsetProjectProperties(java.util.Properties projectProperties)DefaultProfileActivationContextsetSystemProperties(java.util.Map<java.lang.String,java.lang.String> systemProperties)Sets the system properties to use for interpolation and profile activation.DefaultProfileActivationContextsetSystemProperties(java.util.Properties systemProperties)Sets the system properties to use for interpolation and profile activation.DefaultProfileActivationContextsetUserProperties(java.util.Map<java.lang.String,java.lang.String> userProperties)Sets the user properties to use for interpolation and profile activation.DefaultProfileActivationContextsetUserProperties(java.util.Properties userProperties)Sets the user properties to use for interpolation and profile activation.
-
-
-
Method Detail
-
getActiveProfileIds
public java.util.List<java.lang.String> getActiveProfileIds()
Description copied from interface:ProfileActivationContextGets the identifiers of those profiles that should be activated by explicit demand.- Specified by:
getActiveProfileIdsin interfaceProfileActivationContext- Returns:
- The identifiers of those profiles to activate, never
null.
-
setActiveProfileIds
public DefaultProfileActivationContext setActiveProfileIds(java.util.List<java.lang.String> activeProfileIds)
Sets the identifiers of those profiles that should be activated by explicit demand.- Parameters:
activeProfileIds- The identifiers of those profiles to activate, may benull.- Returns:
- This context, never
null.
-
getInactiveProfileIds
public java.util.List<java.lang.String> getInactiveProfileIds()
Description copied from interface:ProfileActivationContextGets the identifiers of those profiles that should be deactivated by explicit demand.- Specified by:
getInactiveProfileIdsin interfaceProfileActivationContext- Returns:
- The identifiers of those profiles to deactivate, never
null.
-
setInactiveProfileIds
public DefaultProfileActivationContext setInactiveProfileIds(java.util.List<java.lang.String> inactiveProfileIds)
Sets the identifiers of those profiles that should be deactivated by explicit demand.- Parameters:
inactiveProfileIds- The identifiers of those profiles to deactivate, may benull.- Returns:
- This context, never
null.
-
getSystemProperties
public java.util.Map<java.lang.String,java.lang.String> getSystemProperties()
Description copied from interface:ProfileActivationContextGets the system properties to use for interpolation and profile activation. The system properties are collected from the runtime environment likeSystem.getProperties()and environment variables.- Specified by:
getSystemPropertiesin interfaceProfileActivationContext- Returns:
- The execution properties, never
null.
-
setSystemProperties
public DefaultProfileActivationContext setSystemProperties(java.util.Properties systemProperties)
Sets the system properties to use for interpolation and profile activation. The system properties are collected from the runtime environment likeSystem.getProperties()and environment variables.- Parameters:
systemProperties- The system properties, may benull.- Returns:
- This context, never
null.
-
setSystemProperties
public DefaultProfileActivationContext setSystemProperties(java.util.Map<java.lang.String,java.lang.String> systemProperties)
Sets the system properties to use for interpolation and profile activation. The system properties are collected from the runtime environment likeSystem.getProperties()and environment variables.- Parameters:
systemProperties- The system properties, may benull.- Returns:
- This context, never
null.
-
getUserProperties
public java.util.Map<java.lang.String,java.lang.String> getUserProperties()
Description copied from interface:ProfileActivationContextGets the user properties to use for interpolation and profile activation. The user properties have been configured directly by the user on his discretion, e.g. via the-Dkey=valueparameter on the command line.- Specified by:
getUserPropertiesin interfaceProfileActivationContext- Returns:
- The user properties, never
null.
-
setUserProperties
public DefaultProfileActivationContext setUserProperties(java.util.Properties userProperties)
Sets the user properties to use for interpolation and profile activation. The user properties have been configured directly by the user on his discretion, e.g. via the-Dkey=valueparameter on the command line.- Parameters:
userProperties- The user properties, may benull.- Returns:
- This context, never
null.
-
setUserProperties
public DefaultProfileActivationContext setUserProperties(java.util.Map<java.lang.String,java.lang.String> userProperties)
Sets the user properties to use for interpolation and profile activation. The user properties have been configured directly by the user on his discretion, e.g. via the-Dkey=valueparameter on the command line.- Parameters:
userProperties- The user properties, may benull.- Returns:
- This context, never
null.
-
getProjectDirectory
public java.io.File getProjectDirectory()
Description copied from interface:ProfileActivationContextGets the base directory of the current project (if any).- Specified by:
getProjectDirectoryin interfaceProfileActivationContext- Returns:
- The base directory of the current project or
nullif none.
-
setProjectDirectory
public DefaultProfileActivationContext setProjectDirectory(java.io.File projectDirectory)
Sets the base directory of the current project.- Parameters:
projectDirectory- The base directory of the current project, may benullif profile activation happens in the context of metadata retrieval rather than project building.- Returns:
- This context, never
null.
-
getProjectProperties
public java.util.Map<java.lang.String,java.lang.String> getProjectProperties()
Description copied from interface:ProfileActivationContextGets current calculated project properties- Specified by:
getProjectPropertiesin interfaceProfileActivationContext- Returns:
- The project properties, never
null.
-
setProjectProperties
public DefaultProfileActivationContext setProjectProperties(java.util.Properties projectProperties)
-
-