Package org.apache.maven.impl.model
Class DefaultProfileActivationContext
java.lang.Object
org.apache.maven.impl.model.DefaultProfileActivationContext
- All Implemented Interfaces:
- ProfileActivationContext
Describes the environmental context used to determine the activation status of profiles.
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultProfileActivationContext(PathTranslator pathTranslator, RootLocator rootLocator, Interpolator interpolator) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanChecks if a file or directory matching the given glob pattern exists at the specified path.Gets the artifactId from the current model.Gets the base directory of the current model.Gets the packaging type from the current model.getModelProperty(String key) Gets the model property to use for interpolation and profile activation.Gets the root directory of the current model.getSystemProperty(String key) Gets the system property to use for interpolation and profile activation.getUserProperty(String key) Gets the user property to use for interpolation and profile activation.interpolatePath(String path) Interpolates the given path string using the current context's properties.booleanisProfileActive(String profileId) Checks if the specified profile has been explicitly activated.booleanisProfileInactive(String profileId) Checks if the specified profile has been explicitly deactivated.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.setSystemProperties(Map<String, String> 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.
- 
Constructor Details- 
DefaultProfileActivationContextpublic DefaultProfileActivationContext(PathTranslator pathTranslator, RootLocator rootLocator, Interpolator interpolator) 
 
- 
- 
Method Details- 
isProfileActiveDescription copied from interface:ProfileActivationContextChecks if the specified profile has been explicitly activated.- Specified by:
- isProfileActivein interface- ProfileActivationContext
- Parameters:
- profileId- the profile id
- Returns:
- whether the profile has been activated
 
- 
setActiveProfileIdsSets the identifiers of those profiles that should be activated by explicit demand.- Parameters:
- activeProfileIds- The identifiers of those profiles to activate, may be- null.
- Returns:
- This context, never null.
 
- 
isProfileInactiveDescription copied from interface:ProfileActivationContextChecks if the specified profile has been explicitly deactivated.- Specified by:
- isProfileInactivein interface- ProfileActivationContext
- Parameters:
- profileId- the profile id
- Returns:
- whether the profile has been deactivated
 
- 
setInactiveProfileIdsSets the identifiers of those profiles that should be deactivated by explicit demand.- Parameters:
- inactiveProfileIds- The identifiers of those profiles to deactivate, may be- null.
- Returns:
- This context, never null.
 
- 
getSystemPropertyDescription copied from interface:ProfileActivationContextGets the system property to use for interpolation and profile activation. The system properties are collected from the runtime environment likeSystem.getProperties()and environment variables.- Specified by:
- getSystemPropertyin interface- ProfileActivationContext
- Parameters:
- key- the name of the system property
- Returns:
- the system property for the specified key, or null
 
- 
setSystemPropertiesSets 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 be- null.
- Returns:
- This context, never null.
 
- 
getUserPropertyDescription copied from interface:ProfileActivationContextGets the user property 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:
- getUserPropertyin interface- ProfileActivationContext
- Parameters:
- key- the name of the user property
- Returns:
- The user property for the specified key, or null.
 
- 
setUserPropertiesSets 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 be- null.
- Returns:
- This context, never null.
 
- 
getModelArtifactIdDescription copied from interface:ProfileActivationContextGets the artifactId from the current model.- Specified by:
- getModelArtifactIdin interface- ProfileActivationContext
- Returns:
- The artifactId of the current model, or nullif not set.
 
- 
getModelPackagingDescription copied from interface:ProfileActivationContextGets the packaging type from the current model.- Specified by:
- getModelPackagingin interface- ProfileActivationContext
- Returns:
- The packaging type of the current model, or nullif not set.
 
- 
getModelPropertyDescription copied from interface:ProfileActivationContextGets the model property to use for interpolation and profile activation.- Specified by:
- getModelPropertyin interface- ProfileActivationContext
- Parameters:
- key- the name of the model property
- Returns:
- The model property for the specified key, or null;
 
- 
getModelBaseDirectoryDescription copied from interface:ProfileActivationContextGets the base directory of the current model.- Specified by:
- getModelBaseDirectoryin interface- ProfileActivationContext
- Returns:
- The base directory path of the current model, or nullif not set.
 
- 
getModelRootDirectoryDescription copied from interface:ProfileActivationContextGets the root directory of the current model.- Specified by:
- getModelRootDirectoryin interface- ProfileActivationContext
- Returns:
- The root directory path of the current model, or nullif not set.
 
- 
setModel
- 
interpolatePathDescription copied from interface:ProfileActivationContextInterpolates the given path string using the current context's properties.- Specified by:
- interpolatePathin interface- ProfileActivationContext
- Parameters:
- path- The path string to interpolate
- Returns:
- The interpolated path string
- Throws:
- InterpolatorException- if an error occurs during interpolation
 
- 
existsDescription copied from interface:ProfileActivationContextChecks if a file or directory matching the given glob pattern exists at the specified path.- Specified by:
- existsin interface- ProfileActivationContext
- Parameters:
- path- the base path to check
- enableGlob- whether the path can be a glob expression
- Returns:
- trueif a matching file exists,- falseotherwise
- Throws:
- ModelBuilderException- if an error occurs while checking the path
 
 
-