Package com.linecorp.armeria.common.util
Class Version
java.lang.Object
com.linecorp.armeria.common.util.Version
public final class Version extends Object
Retrieves the version information of available Armeria artifacts.
This class retrieves the version information from
META-INF/com.linecorp.armeria.versions.properties
, which is generated in build time. Note that
it may not be possible to retrieve the information completely, depending on your environment, such as
the specified ClassLoader
, the current SecurityManager
.
-
Method Summary
Modifier and Type Method Description String
artifactId()
Returns the Maven artifact ID of the component, such as"armeria-grpc"
.String
artifactVersion()
Returns the Maven artifact version of the component, such as"1.0.0"
.long
commitTimeMillis()
Returns when the release commit was created.static Version
get(String artifactId)
Returns the version information for the Armeria artifact namedartifactId
.static Version
get(String artifactId, ClassLoader classLoader)
Returns the version information for the Armeria artifact namedartifactId
using the specifiedClassLoader
.static Map<String,Version>
getAll()
Retrieves the version information of Armeria artifacts.static Map<String,Version>
getAll(ClassLoader classLoader)
Retrieves the version information of Armeria artifacts using the specifiedClassLoader
.boolean
isRepositoryClean()
Returns whether the repository was clean when performing the release process.String
longCommitHash()
Returns the long hash of the release commit.String
repositoryStatus()
Returns the status of the repository when performing the release process.String
shortCommitHash()
Returns the short hash of the release commit.String
toString()
-
Method Details
-
get
Returns the version information for the Armeria artifact namedartifactId
. If information for the artifact can't be found, a default value is returned with arbitraryunknown
values. -
get
Returns the version information for the Armeria artifact namedartifactId
using the specifiedClassLoader
. If information for the artifact can't be found, a default value is returned with arbitraryunknown
values. -
getAll
Retrieves the version information of Armeria artifacts. This method is a shortcut foridentify(Version.class.getClassLoader())
. -
getAll
Retrieves the version information of Armeria artifacts using the specifiedClassLoader
. -
artifactId
Returns the Maven artifact ID of the component, such as"armeria-grpc"
. -
artifactVersion
Returns the Maven artifact version of the component, such as"1.0.0"
. -
commitTimeMillis
public long commitTimeMillis()Returns when the release commit was created. -
shortCommitHash
Returns the short hash of the release commit. -
longCommitHash
Returns the long hash of the release commit. -
repositoryStatus
Returns the status of the repository when performing the release process.- Returns:
"clean"
if the repository was clean."dirty"
otherwise.
-
isRepositoryClean
public boolean isRepositoryClean()Returns whether the repository was clean when performing the release process. This method is a shortcut for"clean".equals(repositoryStatus())
. -
toString
-