com.atlassian.confluence.setup
Enum BuildInformation

java.lang.Object
  extended by java.lang.Enum<BuildInformation>
      extended by com.atlassian.confluence.setup.BuildInformation
All Implemented Interfaces:
Serializable, Comparable<BuildInformation>

public enum BuildInformation
extends Enum<BuildInformation>

Singleton which provides build and version information for the Confluence application. Configuration is read from "com/atlassian/confluence/default.properties" on the classpath.

Note that the build number in the application's home directory or database may differ from the version of the application at various times. This object only represents the build information of the application itself.


Enum Constant Summary
INSTANCE
           
 
Field Summary
static String TIMESTMP_FMT
           
 
Method Summary
 String getBambooBuildKey()
          Returns the Bamboo build key of the build producing this artifact.
 String getBambooBuildNumber()
           
 Date getBuildDate()
           
 String getBuildNumber()
           
 Date getBuildTimestamp()
           
 String getBuildYear()
           
 String getGitCommitHash()
          Returns the SHA-1 hash of the Git commit object this artifact is based on.
 String getMajorVersion()
           
 String getRevisionNumber()
          Deprecated. use getGitCommitHash() instead
 String getVersionNumber()
           
 String toString()
           
static BuildInformation valueOf(String name)
          Returns the enum constant of this type with the specified name.
static BuildInformation[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INSTANCE

public static final BuildInformation INSTANCE
Field Detail

TIMESTMP_FMT

public static final String TIMESTMP_FMT
See Also:
Constant Field Values
Method Detail

values

public static BuildInformation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (BuildInformation c : BuildInformation.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static BuildInformation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getVersionNumber

public String getVersionNumber()
Returns:
the version number of this release of Confluence. Components are generally separated by either dots or dashes. Pre-release versions include letters as well as numbers. Sample release versions: 2.0, 2.8.2. Sample pre-release versions: 3.0-SNAPSHOT, 2.9-m4, 2.10-rc1.

getMajorVersion

public String getMajorVersion()

getBuildDate

public Date getBuildDate()
Returns:
the date this version of Confluence was built

getBuildYear

public String getBuildYear()
Returns:
the year this version of Confluence was built
See Also:
getBuildDate()

getBuildTimestamp

public Date getBuildTimestamp()
Returns:
the timestamp this version of Confluence was built

getBuildNumber

public String getBuildNumber()
Returns:
a unique number for each release of Confluence. Used primarily to manage the execution of upgrade tasks. May be a value like '@BUILD_NUMBER@' during development.

getRevisionNumber

public String getRevisionNumber()
Deprecated. use getGitCommitHash() instead


getGitCommitHash

public String getGitCommitHash()
Returns the SHA-1 hash of the Git commit object this artifact is based on.

In case of a released artifact, points to a commit updating the POMs to point to the getVersionNumber().

The value may be "UNKNOWN" in case this is not a released artifact and the builder did not have Git available on his PATH or the artifact was build from a non-Git managed folder structure.

Returns:
SHA-1 of the Git commit object this artifact is based on, or empty
Since:
5.0

getBambooBuildKey

public String getBambooBuildKey()
Returns the Bamboo build key of the build producing this artifact.

The build key looks like e.g. BAM-MAIN-JOBX which identifies a job in a Bamboo plan.
You can identify the execution by composing the Bamboo build key with the Bamboo build number, <baseUrl>/browse/<bambooBuildKey>-<bambooBuildNumber>.

Returns:
the Bamboo build key of the build producing this artifact, or empty if built by other means
Since:
5.0

getBambooBuildNumber

public String getBambooBuildNumber()
Returns:
the ${bamboo.buildNumber} of the build producing this artifact, or empty if built by other means
See Also:
getBambooBuildKey()

toString

public String toString()
Overrides:
toString in class Enum<BuildInformation>


Copyright © 2003-2013 Atlassian. All Rights Reserved.