Class RequireEnvironmentVariable
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
org.apache.maven.enforcer.rules.property.AbstractPropertyEnforcerRule
org.apache.maven.enforcer.rules.property.RequireEnvironmentVariable
- All Implemented Interfaces:
EnforcerRuleBase
@Named("requireEnvironmentVariable")
public final class RequireEnvironmentVariable
extends AbstractPropertyEnforcerRule
This rule checks that certain environment variable is set.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIf the rule is to be cached during session scope, whole executing of Maven build, this id is used as part of the key.getName()How the property that is being evaluated is calledThe name of the property currently being evaluated, this is used for default message purposes onlyResolves the property valuevoidsetVariableName(String variableName) toString()Methods inherited from class AbstractPropertyEnforcerRule
execute, getRegex, getRegexMessage, setRegex, setRegexMessageMethods inherited from class AbstractStandardEnforcerRule
formatLocation, getMessage, setMessageMethods inherited from class AbstractEnforcerRule
getLevel, getRuleNameMethods inherited from class AbstractEnforcerRuleBase
getLog, setLog
-
Field Details
-
variableName
Specify the required variable.
-
-
Constructor Details
-
RequireEnvironmentVariable
public RequireEnvironmentVariable()
-
-
Method Details
-
setVariableName
-
resolveValue
Description copied from class:AbstractPropertyEnforcerRuleResolves the property value- Specified by:
resolveValuein classAbstractPropertyEnforcerRule- Returns:
- a resolve value
-
getCacheId
Description copied from class:AbstractEnforcerRuleIf 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:
getCacheIdin classAbstractEnforcerRule- Returns:
- id to be used by the Enforcer to determine uniqueness of cache results.
Return
nulldisable cache of rule executing.
-
getPropertyName
Description copied from class:AbstractPropertyEnforcerRuleThe name of the property currently being evaluated, this is used for default message purposes only- Specified by:
getPropertyNamein classAbstractPropertyEnforcerRule- Returns:
- the name of the property
-
getName
Description copied from class:AbstractPropertyEnforcerRuleHow the property that is being evaluated is called- Specified by:
getNamein classAbstractPropertyEnforcerRule- Returns:
- kind of property
-
toString
-