Documentation for JIRA 4.4. Documentation for other versions of JIRA is available too.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Section
Column

Commercial users receive access to JIRA's source code. This topic explains how to build this source code back into a deployable JIRA application.

Building JIRA from source is only necessary if need to make modifications to JIRA's source code. You should not need to rebuild JIRA if:

  • You need to change JSP files.
  • Create a JIRA plugin that adds functionality to JIRA. For more information, read the JIRA Plugin Guide.
    (Often, changes and enhancements to JIRA's functionality can be made via a JIRA plugin without requiring core JIRA source code modifications.)
Column
width400px
Panel

 On this page:

Table of Contents

Include Page
_hostedNotApplicableNote
_hostedNotApplicableNote

...

  1. Ensure you have JDK 1.6 or higher and have a Subversion client installed.
  2. Download Maven 2.1.0 from the Apache archives of the Maven website.
    (warning) We have not yet tested building JIRA from source using Maven 3 at this time.
  3. Extract Maven to an appropriate location on your operating system. For example,
    On Windows, extract to:

    Code Block
    langhtml
    C:\apache-maven-2.1.0
    

    On Mac/Linux, extract to:

    Code Block
    langhtml
    /usr/local/apache-maven-2.1.0
    
  4. Set the M2_HOME environment variable. For example,
    On Windows:

    Code Block
    langhtml
    > set M2_HOME=C:\apache-maven-2.1.0
    
    Tip

    Alternatively, the Windows environment variables can be configured by choosing My Computer >> Properties >> Advanced >> Environment Variables.

    On Mac/Linux:

    Code Block
    langhtml
    export M2_HOME=/usr/local/apache-maven-2.1.0
    
  5. Add Maven's bin directory to your path. For example,
    On Windows:

    Code Block
    langhtml
    > set PATH=%M2_HOME%\bin
    
    Tip

    You can set this via My Computer >> Properties >> Advanced >> Environment Variables again if you wish.

    On Mac/Linux:

    Code Block
    langhtml
    export PATH=$PATH:$M2_HOME/bin
    

    Anchor
    thirdpartylibraries
    thirdpartylibraries

  6. Install all of the following restricted third party (.jar) libraries to your local Maven repository (.m2), ensuring that you download the version specified below. All of these libraries are required to successfully build JIRA from source. If any of these libraries are missing, the build process will fail.
    (info)Due to licensing restrictions, we are unable to distribute these third party libraries from Atlassian's public Maven repository. If you have built previous versions of JIRA from source, you may already have some of these libraries in your local Maven repository.

    Libraries

    Maven groupId and artifactId

    Version

    Download URL

    activation

    javax.activation:activation

    1.0.2

    http://repository.jboss.org/nexus/service/local/repositories/deprecated/content/javax/activation/activation/1.0.2/activation-1.0.2.jar

    jms

    javax.jms:jms

    1.1

    http://repository.jboss.org/nexus/content/groups/public-jboss/javax/jms/jms/1.1/

    jmxri
     and
    jmxtools

    com.sun.jmx:jmxri
          and
    com.sun.jdmk:jmxtools

    1.2.1

     

    http://www.oracle.com/technetwork/java/javase/tech/download-jsp-141676.html

    (Download 'JMX 1.2.1 Reference Implementation')

    jndi

    jndi:jndi

    1.2.1

    http://java.sun.com/products/jndi/downloads/index.html

    jta

    jta:jta

    1.0.1B

     

    http://www.oracle.com/technetwork/java/javaee/jta/index.html

    (Download 'Class Files 1.0.1B')

    mail

    javax.mail:mail

    1.3.2

    http://www.oracle.com/technetwork/java/javamail-1-3-2-138617.html


    To install these restricted third party libraries:

    1. Download each one (from its link above) into a directory on your file system, for example, downloads in your home directory area.
      (warning) The jmxri, jmxtools, jndi, jta and mail libraries are downloaded as .zipfiles and before you can install these libraries into your local Maven repository, either:
      • a key .jar file must be extracted from them or
      • they need to be in .jar form.
      1. For jmxri and jmxtools:
        • On Windows:
          Use Windows Explorer to enter the downloads directory and extract the jmxri.jar and jmxtools.jar files from the jmx-1_2_1-bin\lib subdirectory of the jmx-1_2_1-ri.zip file.
        • On Linux:

          Code Block
          langhtml
          cd $HOME/Downloads
          unzip jmx-1_2_1-ri.zip jmx-1_2_1-bin/lib/jmxri.jar jmx-1_2_1-bin/lib/jmxtools.jar
          
      2. For jndi:
        • On Windows:
          Use Windows Explorer to enter the downloads directory and extract the jndi.jar file from the lib subdirectory of the jndi-1_2_1.zip file.
        • On Mac/Linux:

          Code Block
          langhtml
          cd $HOME/Downloads
          unzip jndi-1_2_1.zip lib/jndi.jar
          
      3. For jta:
        • On Windows:
          Use Windows Explorer to enter the downloads directory and rename the jta-1_0_1B-classes.zip file to jta-1_0_1B-classes.jar
        • On Mac/Linux:

          Code Block
          langhtml
          cd $HOME/Downloads
          mv jta-1_0_1B.zip jta-1_0_1B.jar
          
      4. For mail:
        • On Windows:
          Use Windows Explorer to enter the downloads directory and extract the mail.jar file from the javamail-1.3.2 subdirectory of the javamail-1.3.2.zip file.
        • On Mac/Linux:

          Code Block
          langhtml
          cd $HOME/Downloads
          unzip javamail-1.3.2.zip javamail-1.3.2/mail.jar
          
    2. Once you have downloaded, expanded and renamed each of these libraries, install them into your local Maven repository. For example, in your downloadsdirectory, enter the following commands:

      Code Block
      langhtml
      mvn install:install-file -DgroupId=javax.activation -DartifactId=activation -Dversion=1.0.2 -Dpackaging=jar -Dfile=activation-1.0.2.jar
      mvn install:install-file -DgroupId=javax.jms -DartifactId=jms -Dversion=1.1 -Dpackaging=jar -Dfile=jms-1.1.jar
      mvn install:install-file -DgroupId=com.sun.jmx -DartifactId=jmxri -Dversion=1.2.1 -Dpackaging=jar -Dfile=jmxri.jar
      mvn install:install-file -DgroupId=com.sun.jdmk -DartifactId=jmxtools -Dversion=1.2.1 -Dpackaging=jar -Dfile=jmxtools.jar
      mvn install:install-file -DgroupId=jndi -DartifactId=jndi -Dversion=1.2.1 -Dpackaging=jar -Dfile=jndi.jar
      mvn install:install-file -DgroupId=jta -DartifactId=jta -Dversion=1.0.1 -Dpackaging=jar -Dfile=jta-1_0_1B-classes.jar
      mvn install:install-file -DgroupId=javax.mail -DartifactId=mail -Dversion=1.3.2 -Dpackaging=jar -Dfile=mail.jar
      
  7. Download the JIRA source archive from http://www.atlassian.com/software/jira/JIRASourceDownloads.jspa.
    (info) You will need to log in as a user with a commercial license to access this page.

    Anchor
    extractjirasource
    extractjirasource
  8. Extract the JIRA source archive to a location of your choice. This will create a subdirectory with the name atlassian-jira-X.Y-source, where X.Y is your version of JIRA. For example, C:\atlassian-jira-4.3-source
  9. Change directory into this subdirectory and build JIRA by executing the following Maven 2 command. For example,
    On Windows:

    Code Block
    C:\atlassian-jira-4.3-source\> build.bat
    

    On Mac/Linux:

    Code Block
    > build.sh
    
    Note

    The build script will download several dependencies from Atlassian's public Maven repository.

    On rare occasions, however, the build process may fail and you may receive an error similar to the one encountered when an Atlassian product is unable to install a plugin from Atlassian's public Maven repository. This problem is caused by the JVM being unable to access its default 'cacerts' file, which contains a certificate that trusts Atlassian's public Maven repository.

    To resolve this problem:

  10. A WAR file called jira-webapp-dist-X.Y.war (where X.Y is your version of JIRA), will be built in the jira-project/jira-distribution/jira-webapp-dist/target subdirectory of your extracted JIRA source directory.

    For example, if the subdirectory created above was C:\atlassian-jira-4.3-source, the WAR file will be found in:
    C:\atlassian-jira-4.3-source\jira-project\jira-distribution\jira-webapp-dist\target\jira-webapp-dist-4.3.war

    (info) An unpacked version of your JIRA source build can also be found in the jira-project/jira-distribution/jira-webapp-dist/target/jira-webapp-dist-X.Y subdirectory of your extracted JIRA source directory.
  11. The WAR file generated can now be installed into your application server to run the JIRA application you just built. For more information, refer to the JIRA WAR Configuration Overview. For specific installation instructions, you can follow these procedures, skipping stages 1 and 3:

...

When building JIRA from source, Maven will fetch the binary (compiled) dependencies that it requires automatically during the build process, so you do not have to do it manually (with the exception of the third party libraries mentioned above).

It is worth noting that JIRA's source distribution not only ships with JIRA's source code, it also includes the source of the internal Atlassian projects that JIRA depends on (e.g. atlassian-bonnie, atlassian-core, etc.). These internal Atlassian dependencies are also built from source when you build JIRA.

...