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 Modifier and Type Field Description private java.lang.String
variableName
Specify the required variable.
-
Constructor Summary
Constructors Constructor Description RequireEnvironmentVariable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCacheId()
If the rule is to be cached during session scope, whole executing of Maven build, this id is used as part of the key.java.lang.String
getName()
How the property that is being evaluated is calledjava.lang.String
getPropertyName()
The name of the property currently being evaluated, this is used for default message purposes onlyjava.lang.String
resolveValue()
Resolves the property valuevoid
setVariableName(java.lang.String variableName)
java.lang.String
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, getRuleName
-
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
getLog, setLog
-
-
-
-
Method Detail
-
setVariableName
public void setVariableName(java.lang.String variableName)
-
resolveValue
public java.lang.String resolveValue()
Description copied from class:AbstractPropertyEnforcerRule
Resolves the property value- Specified by:
resolveValue
in classAbstractPropertyEnforcerRule
- Returns:
- a resolve value
-
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 classAbstractEnforcerRule
- Returns:
- id to be used by the Enforcer to determine uniqueness of cache results.
Return
null
disable cache of rule executing.
-
getPropertyName
public java.lang.String 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
public java.lang.String 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-