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:
    • getBuildJavaVersion

      public static Optional<String> getBuildJavaVersion()
      Returns the Java 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.0.5

      See Also:
    • getBuildSystem

      public static Optional<String> getBuildSystem()
      Returns information about the system that performed the build, if build-time Git information is available, when Polaris has been built with the Gradle -Prelease project property.

      Example value: Linux myawesomehost 6.12.6 #81 SMP PREEMPT_DYNAMIC Fri Dec 20 09:22:38 CET 2024 x86_64 x86_64 x86_64 GNU/Linux

      See Also:
    • getBuildTimestamp

      public static Optional<String> getBuildTimestamp()
      Returns the build timestamp 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: 2024-12-16-11:54:05+01:00

      See Also:
    • readNoticeFile

      public static String readNoticeFile()
    • readSourceLicenseFile

      public static String readSourceLicenseFile()