com.atlassian.jira.util
Interface BuildUtilsInfo

All Known Implementing Classes:
BuildUtilsInfoImpl

@PublicApi
public interface BuildUtilsInfo

Provides version information about the currently running build of JIRA.

Since:
v4.0

Method Summary
 int getApplicationBuildNumber()
          Gets the build number of this JIRA install.
 String getApplinksVersion()
          Returns the version of AppLinks that JIRA ships with.
 String getBuildInformation()
          Gets a build information summary as a String.
 String getBuildPartnerName()
          Gets the partner name of this JIRA build
 String getBuildProperty(String key)
           
 String getCommitId()
          Returns the id of the SCM commit that was used to make this build of JIRA.
 Date getCurrentBuildDate()
          Gets the date this version of JIRA was built on.
 String getCurrentBuildNumber()
          Gets the current build number of JIRA.
 int getDatabaseBuildNumber()
          Gets the build number of the database that this JIRA instance points to.
 String getGuavaOsgiVersion()
           
 String getMinimumUpgradableBuildNumber()
          Gets the minimal build number that JIRA can upgrade from
 String getMinimumUpgradableVersion()
          Get the minimum version of JIRA that can be upgraded to this instance version.
 String getSalVersion()
          Returns the version of Atlassian SAL that JIRA exports into OSGI-land.
 String getSvnRevision()
          Deprecated. Use getCommitId() instead. Since v5.1.
 Collection<Locale> getUnavailableLocales()
           
 String getVersion()
          Gets the current version of JIRA
 int[] getVersionNumbers()
          Gets the numerical components of the version.
 

Method Detail

getVersion

String getVersion()
Gets the current version of JIRA

Returns:
the current version of JIRA

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 guarenteed 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:
    getDatabaseBuildNumber(), getApplicationBuildNumber()

    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()

    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:
    getCurrentBuildNumber()

    getMinimumUpgradableBuildNumber

    String getMinimumUpgradableBuildNumber()
    Gets the minimal build number that JIRA can upgrade from

    Returns:
    the minimal build number that JIRA can upgrade from

    getCurrentBuildDate

    Date getCurrentBuildDate()
    Gets the date this version of JIRA was built on.

    Returns:
    the date this version of JIRA was built on

    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) shold be exported as

    getBuildProperty

    String getBuildProperty(String key)


    Copyright © 2002-2013 Atlassian. All Rights Reserved.