public abstract class AbstractVersionEnforcer extends AbstractStandardEnforcerRule
| Modifier and Type | Field and Description |
|---|---|
String |
version
Deprecated.
the visibility will be reduced to private with the next major version
|
message| Constructor and Description |
|---|
AbstractVersionEnforcer() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsVersion(org.apache.maven.artifact.versioning.VersionRange allowedRange,
org.apache.maven.artifact.versioning.ArtifactVersion theVersion)
Copied from Artifact.VersionRange.
|
void |
enforceVersion(org.apache.maven.plugin.logging.Log log,
String variableName,
String requiredVersionRange,
org.apache.maven.artifact.versioning.ArtifactVersion actualVersion)
Compares the specified version to see if it is allowed by the defined version range.
|
String |
getCacheId() |
String |
getVersion()
Gets the required version.
|
boolean |
isCacheable() |
boolean |
isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule theCachedRule) |
void |
setVersion(String theVersion)
Sets the required version.
|
getMessage, setMessagepublic String version
2.0.4 Version 2.0.4 and higher (different from Maven meaning)[2.0,2.1) Versions 2.0 (included) to 2.1 (not included)[2.0,2.1] Versions 2.0 to 2.1 (both included)[2.0.5,) Versions 2.0.5 and higher(,2.0.5],[2.1.1,) Versions up to 2.0.5 (included) and 2.1.1 or higher#setVersion(String)},
#getVersion()}public void enforceVersion(org.apache.maven.plugin.logging.Log log,
String variableName,
String requiredVersionRange,
org.apache.maven.artifact.versioning.ArtifactVersion actualVersion)
throws org.apache.maven.enforcer.rule.api.EnforcerRuleException
log - the logvariableName - name of variable to use in messages (Example: "Maven" or "Java" etc).requiredVersionRange - range of allowed versions.actualVersion - the version to be checked.org.apache.maven.enforcer.rule.api.EnforcerRuleException - the enforcer rule exceptionpublic static boolean containsVersion(org.apache.maven.artifact.versioning.VersionRange allowedRange,
org.apache.maven.artifact.versioning.ArtifactVersion theVersion)
allowedRange - range of allowed versions.theVersion - the version to be checked.public String getCacheId()
public boolean isCacheable()
public boolean isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule theCachedRule)
public final String getVersion()
public final void setVersion(String theVersion)
theVersion - the required version to setCopyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.