Class RequireEnvironmentVariable

  • All Implemented Interfaces:
    EnforcerRuleBase

    @Named("requireEnvironmentVariable")
    public final class RequireEnvironmentVariable
    extends AbstractPropertyEnforcerRule
    This rule checks that certain environment variable is set.
    • Field Detail

      • variableName

        private java.lang.String variableName
        Specify the required variable.
    • Constructor Detail

      • RequireEnvironmentVariable

        public RequireEnvironmentVariable()
    • Method Detail

      • setVariableName

        public void setVariableName​(java.lang.String variableName)
      • getCacheId

        public java.lang.String getCacheId()
        Description copied from class: AbstractEnforcerRule
        If the rule is to be cached during session scope, whole executing of Maven build, this id is used as part of the key.

        Rule of the same class and the same cache id will be executed once.

        Overrides:
        getCacheId in class AbstractEnforcerRule
        Returns:
        id to be used by the Enforcer to determine uniqueness of cache results. Return null disable cache of rule executing.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object