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 AbstractPropertyEnforcerRuleThis rule checks that certain environment variable is set.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringvariableNameSpecify the required variable.
-
Constructor Summary
Constructors Constructor Description RequireEnvironmentVariable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetCacheId()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.StringgetName()How the property that is being evaluated is calledjava.lang.StringgetPropertyName()The name of the property currently being evaluated, this is used for default message purposes onlyjava.lang.StringresolveValue()Resolves the property valuevoidsetVariableName(java.lang.String variableName)java.lang.StringtoString()-
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:AbstractPropertyEnforcerRuleResolves the property value- Specified by:
resolveValuein classAbstractPropertyEnforcerRule- Returns:
- a resolve value
-
getCacheId
public java.lang.String 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
public java.lang.String 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
public java.lang.String getName()
Description copied from class:AbstractPropertyEnforcerRuleHow the property that is being evaluated is called- Specified by:
getNamein classAbstractPropertyEnforcerRule- Returns:
- kind of property
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-