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 valuevoid
setVariableName
(String variableName) toString()
Methods inherited from class org.apache.maven.enforcer.rules.property.AbstractPropertyEnforcerRule
execute, getRegex, getRegexMessage, setRegex, setRegexMessage
Methods inherited from class org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
formatLocation, getMessage, setMessage
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
getLevel
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
getLog, setLog
-
Field Details
-
variableName
Specify the required variable.
-
-
Constructor Details
-
RequireEnvironmentVariable
public RequireEnvironmentVariable()
-
-
Method Details
-
setVariableName
-
resolveValue
Description copied from class:AbstractPropertyEnforcerRule
Resolves the property value- Specified by:
resolveValue
in classAbstractPropertyEnforcerRule
- Returns:
- a resolve value
-
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 classAbstractEnforcerRule
- Returns:
- id to be used by the Enforcer to determine uniqueness of cache results.
Return
null
disable cache of rule executing.
-
getPropertyName
Description copied from class:AbstractPropertyEnforcerRule
The name of the property currently being evaluated, this is used for default message purposes only- Specified by:
getPropertyName
in classAbstractPropertyEnforcerRule
- Returns:
- the name of the property
-
getName
Description copied from class:AbstractPropertyEnforcerRule
How the property that is being evaluated is called- Specified by:
getName
in classAbstractPropertyEnforcerRule
- Returns:
- kind of property
-
toString
-