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:
java.io.Serializable, java.lang.Comparable<BuildInformation>

public enum BuildInformation
extends java.lang.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 java.lang.String TIMESTMP_FMT
           
 
Method Summary
 java.lang.String getBambooBuildKey()
          Returns the Bamboo build key of the build producing this artifact.
 java.lang.String getBambooBuildNumber()
           
 java.util.Date getBuildDate()
           
 java.lang.String getBuildNumber()
           
 java.util.Date getBuildTimestamp()
           
 java.lang.String getBuildYear()
           
 java.lang.String getGitCommitHash()
          Returns the SHA-1 hash of the Git commit object this artifact is based on.
 java.lang.String getMajorVersion()
          Deprecated. since 5.2. Use getVersionNumber().
 java.lang.String getRevisionNumber()
          Deprecated. since 5.0 use getGitCommitHash() instead
 java.lang.String getVersionNumber()
           
 java.lang.String toString()
           
static BuildInformation valueOf(java.lang.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 java.lang.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(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getVersionNumber

public java.lang.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

@Deprecated
public java.lang.String getMajorVersion()
Deprecated. since 5.2. Use getVersionNumber().

Removes the minor version from the version number


getBuildDate

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

getBuildYear

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

getBuildTimestamp

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

getBuildNumber

public java.lang.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

@Deprecated
public java.lang.String getRevisionNumber()
Deprecated. since 5.0 use getGitCommitHash() instead


getGitCommitHash

public java.lang.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 java.lang.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 java.lang.String getBambooBuildNumber()
Returns:
the ${bamboo.buildNumber} of the build producing this artifact, or empty if built by other means
See Also:
getBambooBuildKey()

toString

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


Copyright © 2003-2013 Atlassian. All Rights Reserved.