Package org.apache.maven.rtinfo
Interface RuntimeInformation
-
- All Known Implementing Classes:
DefaultRuntimeInformation
public interface RuntimeInformationProvides information about the current Maven runtime.- Since:
- 3.0.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetMavenVersion()Retrieves the current Maven version, for example "3.0.2".booleanisMavenVersion(java.lang.String versionRange)Checks whether the current Maven runtime matches the specified version range.
-
-
-
Method Detail
-
getMavenVersion
java.lang.String getMavenVersion()
Retrieves the current Maven version, for example "3.0.2".- Returns:
- The current Maven version or an empty string if unknown, never
null.
-
isMavenVersion
boolean isMavenVersion(java.lang.String versionRange)
Checks whether the current Maven runtime matches the specified version range. A version range can either use the usual mathematical syntax "[2.0.10,2.1.0),[3.0,)" or use a single version "2.2.1". The latter is a short form for "[2.2.1,)", i.e. denotes the minimum version required.- Parameters:
versionRange- The version range to match the current Maven runtime against, must not benull.- Returns:
trueif the current Maven runtime matches the specified version range,falseotherwise.- Throws:
java.lang.IllegalArgumentException- If the specified version range isnull, empty or otherwise not a valid version specification.
-
-