Class PolarisVersion

java.lang.Object
org.apache.polaris.version.PolarisVersion

public final class PolarisVersion extends Object
Utility class to retrieve the current Polaris version and the contents of the NOTICE and LICENSE* files.

If built as a release using the Gradle -Prelease project property, more information like the Git tag, Git commit ID, build system and more is available as well.

  • Method Details

    • polarisVersionString

      public static String polarisVersionString()
      The version string as in the file version.txt in the project's root directory.
    • isReleaseBuild

      public static boolean isReleaseBuild()
      Flag whether the build is a released version, when Polaris has been built with the Gradle -Prelease project property. If true, the getBuild* functions return meaningful values.
    • getBuildReleasedVersion

      public static Optional<String> getBuildReleasedVersion()
      Returns the version as in the jar manifest, if build-time Git information is available, when Polaris has been built with the Gradle -Prelease project property..

      Example values: 1.0.0-incubating-SNAPSHOT, 1.0.0-incubating, 1.0.0

      See Also:
    • getBuildGitHead

      public static Optional<String> getBuildGitHead()
      Returns the commit ID as in the jar manifest, if build-time Git information is available, when Polaris has been built with the Gradle -Prelease project property.

      Example value: d417725ec7c88c1ee8f940ffb2ce72aec7fb2a17

      See Also:
    • getBuildGitTag

      public static Optional<String> getBuildGitTag()
      Returns the output of git describe --tags as in the jar manifest, if build-time Git information is available, when Polaris has been built with the Gradle -Prelease project property.

      Example value: apache-polaris-0.1.2

      See Also:
    • getBuildJavaSpecificationVersion

      public static Optional<String> getBuildJavaSpecificationVersion()
      Returns the Java specification version used during the build as in the jar manifest, if build-time Git information is available, when Polaris has been built with the Gradle -Prelease project property.

      Example value: 21

      See Also:
    • readNoticeFile

      public static String readNoticeFile()
    • readSourceLicenseFile

      public static String readSourceLicenseFile()