Interface BuildUtilsInfo

All Known Implementing Classes:
BuildUtilsInfoImpl, ConstrainedBuildUtilsInfo, MockBuildUtilsInfo

@PublicApi public interface BuildUtilsInfo
Provides version information about the currently running build of Jira platform.
Since:
v4.0
  • Method Details

    • getVersion

      String getVersion()
      Gets the current version of Jira
      Returns:
      the current version of Jira
    • getDocVersion

      String getDocVersion()
      Return the version used for Jira documentation.

      This is the version that Jira uses when generating links to its externally hosted documentation.

      Returns:
      the version used for Jira documentation.
      Since:
      6.2.3.
    • getVersionNumbers

      int[] getVersionNumbers()
      Gets the numerical components of the version.

      • "5.0" gives [5, 0, 0]
        "5.0.1" gives [5, 0, 1]
        "5.0-beta1" gives [5, 0, 0]
        "5.0.1-SNAPSHOT" gives [5, 0, 1]
    • The returned array is guaranteed to have at least 3 elements. Any non-numeric suffix in getVersion() is ignored.

      A simple way to use this information is with Guava's Ints.lexicographicalComparator():

        int[] v510 = {5, 1, 0};
        if (Ints.lexicographicalComparator().compare(buildUtils.getVersionNumbers(), v510) >= 0 ) { ...
       
      Returns:
      the leading numerical components of getVersion()
    • getCurrentBuildNumber

      String getCurrentBuildNumber()
      Gets the current build number of Jira.

      This is the same value as getApplicationBuildNumber() except it is returned as a String.

      Returns:
      the current build number of Jira
      See Also:
    • getApplicationBuildNumber

      int getApplicationBuildNumber()
      Gets the build number of this Jira install.

      That is, the build number of the currently running installation files. The DB also stores a build number.

      Returns:
      the build number of this Jira install.
      See Also:
    • getDatabaseBuildNumber

      int getDatabaseBuildNumber()
      Gets the build number of the database that this Jira instance points to.

      Under normal circumstances this will be the same as the build number of the Jira installation. However, when you first upgrade a Jira database or import data exported from an older Jira, the existing database will start on the previous build number. Jira will then run "Upgrade Tasks" to update the data in the DB.

      Returns:
      the build number of the database that Jira points to.
      See Also:
    • getMinimumUpgradableBuildNumber

      String getMinimumUpgradableBuildNumber()
      Gets the minimal build number that Jira can upgrade from
      Returns:
      the minimal build number that Jira can upgrade from
    • getCurrentBuildDate

      @Nullable Date getCurrentBuildDate()
      Gets the date this version of Jira was built on.
      Returns:
      the date this version of Jira was built on, or null if it couldn't be parsed
    • getBuildPartnerName

      String getBuildPartnerName()
      Gets the partner name of this Jira build
      Returns:
      the partner name of this Jira build.
    • getBuildInformation

      String getBuildInformation()
      Gets a build information summary as a String.
      Returns:
      a build information summary
    • getSvnRevision

      @Deprecated String getSvnRevision()
      Deprecated.
      Use getCommitId() instead. Since v5.1.
      Returns the SCM commit id that was used to make this build of Jira. This used to be an SVN revision, but is now a Git commit id (aka a SHA1). This method returns an empty string if Jira was built from the source distribution.
      Returns:
      a String containing the SCM commit id, or an empty String.
    • getCommitId

      String getCommitId()
      Returns the id of the SCM commit that was used to make this build of Jira. This method returns an empty string if Jira was built from the source distribution.
      Returns:
      the SCM commit id that was used to make this build of Jira.
    • getMinimumUpgradableVersion

      String getMinimumUpgradableVersion()
      Get the minimum version of Jira that can be upgraded to this instance version.
      Returns:
      the minimum version that can be upgraded.
    • getUnavailableLocales

      Collection<Locale> getUnavailableLocales()
    • getSalVersion

      String getSalVersion()
      Returns the version of Atlassian SAL that Jira exports into OSGI-land.
      Returns:
      the version of Atlassian SAL that Jira exports
    • getApplinksVersion

      String getApplinksVersion()
      Returns the version of AppLinks that Jira ships with.
      Returns:
      the version of AppLinks that Jira ships with
    • getGuavaOsgiVersion

      String getGuavaOsgiVersion()
      Returns:
      the osgi version that Guava (com.google.common) should be exported as
    • getCrowdOsgiVersion

      String getCrowdOsgiVersion()
      Returns:
      the osgi version for the embedded crowd to be exported with
    • getBuildProperty

      @Nullable String getBuildProperty(String key)
      Returns the value of the build property with the given key.
      Parameters:
      key - the key for which to retrieve the value
      Returns:
      null if the key is unknown
    • isBeta

      boolean isBeta()
      Returns whether the current version is a beta (i.e. has -beta after its version numbers)
      Returns:
      true if the version string has -beta after its version numbers, otherwise false (case-insensitive)
    • isEap

      boolean isEap()
      Indicates whether the current version is an Early Access Program (EAP) release.
      Returns:
      see above
      Since:
      7.4
    • isFinal

      boolean isFinal()
      Indicates whether the current version is a final (GA) release.
      Returns:
      see above
      Since:
      7.4
    • isRc

      boolean isRc()
      Returns whether the current version is a release candidate (i.e. has -rc after its version numbers)
      Returns:
      true if the version string has -rc after its version numbers, otherwise false (case-insensitive)
    • isSnapshot

      boolean isSnapshot()
      Returns whether the current version is a snapshot (i.e. has -SNAPSHOT after its version numbers)
      Returns:
      true if the version string has -SNAPSHOT after its version numbers, otherwise false (case-insensitive)
    • isMilestone

      boolean isMilestone()
      Returns whether the current version is a milestone (i.e. has -mXX after its version numbers)
      Returns:
      true if the version string has -m after its version numbers, otherwise false (case-insensitive)
    • getAuditVersion

      @ExperimentalApi String getAuditVersion()
      Returns the version of Atlassian Audit that Jira exports into OSGI-land.
      Returns:
      the version of Atlassian Audit that Jira exports
      Since:
      8.7