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 Details

    • get

      public static Version get​(String artifactId)
      Returns the version information for the Armeria artifact named artifactId. If information for the artifact can't be found, a default value is returned with arbitrary unknown values.
    • get

      public static Version get​(String artifactId, ClassLoader classLoader)
      Returns the version information for the Armeria artifact named artifactId using the specified ClassLoader. If information for the artifact can't be found, a default value is returned with arbitrary unknown values.
    • getAll

      public static Map<String,​Version> getAll()
      Retrieves the version information of Armeria artifacts. This method is a shortcut for getAll(Version.class.getClassLoader()).
      Returns:
      A Map whose keys are Maven artifact IDs and whose values are Versions
    • getAll

      public static Map<String,​Version> getAll​(ClassLoader classLoader)
      Retrieves the version information of Armeria artifacts using the specified ClassLoader.
      Returns:
      A Map whose keys are Maven artifact IDs and whose values are Versions
    • artifactId

      public String artifactId()
      Returns the Maven artifact ID of the component, such as "armeria-grpc".
    • artifactVersion

      public String 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

      public String shortCommitHash()
      Returns the short hash of the release commit.
    • longCommitHash

      public String longCommitHash()
      Returns the long hash of the release commit.
    • repositoryStatus

      public String 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

      public String toString()
      Overrides:
      toString in class Object