Class DefaultProfileActivationContext
java.lang.Object
org.apache.maven.model.profile.DefaultProfileActivationContext
- All Implemented Interfaces:
ProfileActivationContext
Describes the environmental context used to determine the activation status of profiles.
- Author:
- Benjamin Bentmann
-
Field Summary
Fields inherited from interface ProfileActivationContext
PROPERTY_NAME_PACKAGING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the identifiers of those profiles that should be activated by explicit demand.Gets the identifiers of those profiles that should be deactivated by explicit demand.Gets the base directory of the current project (if any).Gets current calculated project properties.Gets the system properties to use for interpolation and profile activation.Gets the user properties to use for interpolation and profile activation.setActiveProfileIds(List<String> activeProfileIds) Sets the identifiers of those profiles that should be activated by explicit demand.setInactiveProfileIds(List<String> inactiveProfileIds) Sets the identifiers of those profiles that should be deactivated by explicit demand.setProjectDirectory(File projectDirectory) Sets the base directory of the current project.setProjectProperties(Properties projectProperties) setSystemProperties(Map<String, String> systemProperties) Sets the system properties to use for interpolation and profile activation.setSystemProperties(Properties systemProperties) Sets the system properties to use for interpolation and profile activation.setUserProperties(Map<String, String> userProperties) Sets the user properties to use for interpolation and profile activation.setUserProperties(Properties userProperties) Sets the user properties to use for interpolation and profile activation.
-
Constructor Details
-
DefaultProfileActivationContext
public DefaultProfileActivationContext()
-
-
Method Details
-
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
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
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
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
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
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
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
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.In repository-resolved (external) model builds (dependency POMs, parent POMs, imported BOMs), this map is intentionally empty. Consumer
-Dflags are not propagated to dependency profile activation: the consumer did not set those flags for the dependency, and doing so would make dependency resolution non-deterministic and open to accidental (or malicious) profile injection.- Specified by:
getUserPropertiesin interfaceProfileActivationContext- Returns:
- The user properties, never
null.
-
setUserProperties
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
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
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
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
Description copied from interface:ProfileActivationContextGets current calculated project properties.These are the properties declared in the model's own
<properties>section. They are available for interpolation but are not used for profile activation in repository-resolved (external) model builds — a dependency POM's own properties must not activate its own property-based profiles (see #13390).- Specified by:
getProjectPropertiesin interfaceProfileActivationContext- Returns:
- The project properties, never
null.
-
setProjectProperties
-