Class DefaultProfileActivationContext

java.lang.Object
org.apache.maven.impl.model.DefaultProfileActivationContext
All Implemented Interfaces:
org.apache.maven.api.services.model.ProfileActivationContext

public class DefaultProfileActivationContext extends Object implements org.apache.maven.api.services.model.ProfileActivationContext
Describes the environmental context used to determine the activation status of profiles.
  • Constructor Details

    • DefaultProfileActivationContext

      public DefaultProfileActivationContext(org.apache.maven.api.services.model.PathTranslator pathTranslator, org.apache.maven.api.services.model.RootLocator rootLocator, org.apache.maven.api.services.Interpolator interpolator)
    • DefaultProfileActivationContext

      public DefaultProfileActivationContext(org.apache.maven.api.services.model.PathTranslator pathTranslator, org.apache.maven.api.services.model.RootLocator rootLocator, org.apache.maven.api.services.Interpolator interpolator, List<String> activeProfileIds, List<String> inactiveProfileIds, Map<String,String> systemProperties, Map<String,String> userProperties, org.apache.maven.api.model.Model model)
  • Method Details

    • isProfileActive

      public boolean isProfileActive(String profileId)
      Specified by:
      isProfileActive in interface org.apache.maven.api.services.model.ProfileActivationContext
    • isProfileInactive

      public boolean isProfileInactive(String profileId)
      Specified by:
      isProfileInactive in interface org.apache.maven.api.services.model.ProfileActivationContext
    • getSystemProperty

      public String getSystemProperty(String key)
      Specified by:
      getSystemProperty in interface org.apache.maven.api.services.model.ProfileActivationContext
    • setSystemProperties

      public DefaultProfileActivationContext setSystemProperties(Map<String,String> systemProperties)
      Sets the system properties to use for interpolation and profile activation. The system properties are collected from the runtime environment like System.getProperties() and environment variables.
      Parameters:
      systemProperties - The system properties, may be null.
      Returns:
      This context, never null.
    • getUserProperty

      public String getUserProperty(String key)
      Specified by:
      getUserProperty in interface org.apache.maven.api.services.model.ProfileActivationContext
    • setUserProperties

      public DefaultProfileActivationContext setUserProperties(Map<String,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=value parameter on the command line.
      Parameters:
      userProperties - The user properties, may be null.
      Returns:
      This context, never null.
    • getModelArtifactId

      public String getModelArtifactId()
      Specified by:
      getModelArtifactId in interface org.apache.maven.api.services.model.ProfileActivationContext
    • getModelPackaging

      public String getModelPackaging()
      Specified by:
      getModelPackaging in interface org.apache.maven.api.services.model.ProfileActivationContext
    • getModelProperty

      public String getModelProperty(String key)
      Specified by:
      getModelProperty in interface org.apache.maven.api.services.model.ProfileActivationContext
    • getModelBaseDirectory

      public String getModelBaseDirectory()
      Specified by:
      getModelBaseDirectory in interface org.apache.maven.api.services.model.ProfileActivationContext
    • doGetModelBaseDirectory

      public String doGetModelBaseDirectory()
    • getModelRootDirectory

      public String getModelRootDirectory()
      Specified by:
      getModelRootDirectory in interface org.apache.maven.api.services.model.ProfileActivationContext
    • setModel

      public DefaultProfileActivationContext setModel(org.apache.maven.api.model.Model model)
    • interpolatePath

      public String interpolatePath(String path) throws org.apache.maven.api.services.InterpolatorException
      Specified by:
      interpolatePath in interface org.apache.maven.api.services.model.ProfileActivationContext
      Throws:
      org.apache.maven.api.services.InterpolatorException
    • exists

      public boolean exists(String path, boolean enableGlob) throws org.apache.maven.api.services.ModelBuilderException
      Specified by:
      exists in interface org.apache.maven.api.services.model.ProfileActivationContext
      Throws:
      org.apache.maven.api.services.ModelBuilderException