- java.lang.Object
-
- org.scijava.meta.Versions
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringbuildNumber(Class<?> c)Looks up the build number (typically an SCM revision) of the specified class.static intcompare(String v1, String v2)Compares two version strings.static StringfromManifest(Class<?> c)Looks up the version of the specified class using a JAR manifest if available, appending the build number to anySNAPSHOTversion.static StringfromPOM(Class<?> c, String groupId, String artifactId)Looks up the version of the specified class using the specified POM, or base POM directory ifgroupIdandartifactIdarenull.static Stringof(Class<?> c)Looks up the version of the specified class using any means available, appending the build number to anySNAPSHOTversion.static Stringof(Class<?> c, String groupId, String artifactId)Looks up the version of the specified class using any means available, appending the build number to anySNAPSHOTversion.
-
-
-
Method Detail
-
of
public static String of(Class<?> c)
Looks up the version of the specified class using any means available, appending the build number to anySNAPSHOTversion. Will only search POMs in the base directory.- Parameters:
c- - Look up this class's version- Returns:
- Version of specified
Classor null if not found.
-
of
public static String of(Class<?> c, String groupId, String artifactId)
Looks up the version of the specified class using any means available, appending the build number to anySNAPSHOTversion. ThegroupIdandartifactIdparameters allow specification of the POM lookup path.- Parameters:
c- - Look up this class's versiongroupId- - Maven group ID containing classartifactId- - Maven artifact ID containing class- Returns:
- Version of specified
Classor null if not found.
-
fromManifest
public static String fromManifest(Class<?> c)
Looks up the version of the specified class using a JAR manifest if available, appending the build number to anySNAPSHOTversion.- Parameters:
c- - Look up this class's version- Returns:
- Version of specified
Classor null if not found.
-
fromPOM
public static String fromPOM(Class<?> c, String groupId, String artifactId)
Looks up the version of the specified class using the specified POM, or base POM directory ifgroupIdandartifactIdarenull.- Parameters:
c- - Look up this class's versiongroupId- - Maven group ID containing classartifactId- - Maven artifact ID containing class- Returns:
- Version of specified
Classor null if not found.
-
buildNumber
public static String buildNumber(Class<?> c)
Looks up the build number (typically an SCM revision) of the specified class. This information is retrieved from the JAR manifest'sImplementation-Buildentry, or null if no such value exists.- Parameters:
c- - Look up this class's build number- Returns:
- Build number of specified
Classor null if not found.
-
-