Documentation for JIRA 6.3 EAP developer (EAP) releases only. Not using this? See below:
(JIRA 6.2.x documentation | JIRA OnDemand documentation | earlier versions of JIRA)

Skip to end of metadata
Go to start of metadata
Icon

Please be aware that the content on this page is is not included in our Atlassian Support Offerings and consequently Atlassian can not guarantee providing any support for it. Please be aware that this material is provided for your information only and using it is done so at your own risk.

Icon

If you're looking to browse through the source code for reference, you can access it if you have a license for JIRA from My Atlassian's source downloads.

Commercial users at any level receive access to JIRA's source code (note, evaluation license holders are not permitted access to JIRA's source code). This topic explains how to build this source code into a deployable JIRA application.

Building all of JIRA from source is only necessary if you need to make extensive modifications to JIRA's source code and are using a WAR approach.

You should not need to rebuild JIRA if:

  • You need to change many JSP files. JSP files are the template files for many JIRA webpages. They can also be more easily changed directly in the standalone JIRA installation directory.
  • Create a JIRA plugin that adds functionality to JIRA. For more information, read the JIRA Plugin Guide. Changes and enhancements to JIRA's functionality can often be made with JIRA plugins without requiring core JIRA source code modifications.
  • Recompiling a small number of source files can be done using the instructions in the standalone external-source directory.

(warning) There is a known issue where the Workflow Designer source is missing from the JIRA source code which is being tracked under JRA-29615 - Workflow Designer source is missing from the source code delivered with JIRA source code folder Resolved - please keep this is mind when building JIRA from source.

 On this page:

Building a JIRA WAR file from a JIRA Source release

  1. Ensure you have JDK 1.7 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:

    On Mac/Linux, extract to:

  4. Set the M2_HOME environment variable. For example,
    On Windows:

    Icon

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

    On Mac/Linux:

  5. Add Maven's bin directory to your path. For example,
    On Windows:

    Icon

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

    On Mac/Linux:

  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
    ojdbc6com.oracle:ojdbc611.2.0.2.0http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html (Download 'ojdbc6.jar' under 'Oracle Database 11g Release 2 (11.2.0.2.0) JDBC Drivers')


    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:

      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:

      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:

      4. For mail:
        1. 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.
        2. On Mac/Linux:

    2. Once you have downloaded, expanded and renamed each of these libraries, install them into your local Maven repository. For example, in your downloads directory, enter the following commands:

  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.

  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:

    On Mac/Linux:

    Icon

    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:

Developing using the IDE Connectors

Learn about the IDE Connectors from the IDE Connector Documentation.

Obtaining the source of JIRA's dependencies

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.). The internal Atlassian dependencies for JIRA's source distribution are made available as Maven-based archives. There will be a Maven-based archive for each dependency, named <dependencyname-version>-sources.jar. The only buildable part of the source package is JIRA itself, not its dependencies.

Other dependencies are available on Atlassian's public repository. The source of these dependencies is usually available on the library's website (try googling for the library name), or can be identified in the SCM information of the relevant library.

If you have any questions regarding the build process, try searching/posting to the Atlassian Answers, which is monitored by the development community, and by Atlassian as often as possible.

Compiling Single Class Patches

If you just want to compile one class (perhaps a service), we have a step-by-step guide for how to do this in IDEA. See How to Make a JIRA Patch for details.

23 Comments

  1. Anonymous

    Hi Admin,

    It is giving below error

    [FATAL ERROR] Container realm = plexus.core
    urls[0] = file:/G:/atlassian-jira-4.4-source/atlassian-jira-4.4-source/maven/lib/maven-2.1.0-uber.jar
    [INFO] ------------------------------------------------------------------------
    [ERROR] FATAL ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] null
    Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.
    [INFO] ------------------------------------------------------------------------
    [INFO] Trace
    java.lang.ExceptionInInitializerError

    Thanks,

    Vijay

  2. In order to successfully build jira you have to apply this patches:

    Hope, it helps..

    ps: thanks to sleberrigaud from #atlassiandev :)

  3. Anonymous

    Hello,can someone help me with following issue?
    My build environment: Windows 7, Jira source 5.0, JDK 1.6.22, Maven 2.2.1
    I started the build from windows command line, everything went smooth until the build fails with following error:

    [INFO] An Ant BuildException has occured: Javadoc failed: java.io.IOException: Cannot run program "C:\Development\jdk1.6.0_22\bin\javadoc.exe": CreateProcess error=87, The parameter is incorrect

    Can the reason be command line length limit?  As noted here http://blog.gmane.org/gmane.comp.programming.tools.gradle.user/month=20090101/page=5

    How can I solve it or what is the workaround to make the build with no such an error?

    Thanks a lol for any comment

    --Lukas

     

     

    1. Anonymous

      Guess what? I'm having the same issue and I've tried the following with no luck:

      • Subst a drive letter for the path to shorten the build path. I'm basically building at the drive letter.
      • Added the following to the maven build line: -Dmaven.javadoc.skip=true

      It appears to be related to building the REST plugin. Is there something inherent in the WADL document generation that ignores the -Dmaven.javadoc.skip=true flag?

      -- Dave

      1. Anonymous

        Excuse me... I was reading the error above wrong. My specific error is:

        1. Did all those things you tried couldn't get around it so I ended up just commenting out the atlassian-rest-doclet build request in the pom file.  

          As far as I can tell that caused no adverse effects after we installed it.

  4. For 5.0 installing your own copy of Maven is no longer needed (Steps 2 - 3).  

    Maven 2.1 is included in the source (maven folder) and called explicitly from the build.bat script (Step 9)  

    For Step 4 just set M2_HOME to something like M2_HOME=C:\_A\atlassian-jira-5.0.1-source\maven

  5. You might be getting this errors during the build process:

    [ERROR] BUILD ERROR[INFO] ------------------------------------------------------------------------[INFO]
     Failed to resolve artifact. Missing:----------1) jta:jta:jar:1.0.1   
    Try downloading the file manually from the project website.   Then, 
    install it using the command:      mvn install:install-file 
    -DgroupId=jta -DartifactId=jta -Dversion=1.0.1 -Dpackaging=jar 
    -Dfile=/path/to/file   Alternatively, if you host your own repository 
    you can deploy the file there:       mvn deploy:deploy-file 
    -DgroupId=jta -DartifactId=jta -Dversion=1.0.1 -Dpackaging=jar 
    -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
       Path to dependency:        1) 
    com.atlassian.labs:jira4-adapter:jar:0.6.1        2) 
    com.atlassian.jira:atlassian-jira:jar:4.3.4        3) jta:jta:jar:1.0.1 
    2) jndi:jndi:jar:1.2.1   Try downloading the file manually from the 
    project website.   Then, install it using the command:      mvn 
    install:install-file -DgroupId=jndi -DartifactId=jndi 
    -Dversion=1.2.1-Dpackaging=jar -Dfile=/path/to/file   Alternatively, if 
    you host your own repository you can deploy the file there:       mvn 
    deploy:deploy-file -DgroupId=jndi -DartifactId=jndi -Dversion=1.2.1 
    -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
       Path to dependency:        1) 
    com.atlassian.labs:jira4-adapter:jar:0.6.1        2) 
    com.atlassian.jira:atlassian-jira:jar:4.3.4        3) 
    jndi:jndi:jar:1.2.1 ----------2 required artifacts are missing. for 
    artifact:  com.atlassian.labs:jira4-adapter:jar:0.6.1 from the specified
     remote repositories:  central (http://repo1.maven.org/maven2),  atlassian-contrib (https://m2proxy.atlassian.com/contrib),  atlassian-proxy (https://m2proxy.atlassian.com/repository/public) 

    This is because JIRA is looking through at the localrepo directory in the source distribution. The workaround to this issue at the moment is to do the following:

    1. Copy the .m2/repository/jndi and .m2/repository/jta folders
    2. Place them in to the $SOURCEFOLDER/localrepo directory. If it complains that it already exist, over ride the contents.
    3. Rebuild again

    In essence, we are merging the contents of the .m2/repository to that of the $SOURCEFOLDER/localrepo directory

     

    1. Anonymous

      I can't download the following library:

            com.sun.jmx.jmxri.jar v1.2.1

      I have an error while building the project: unable to execute mojo

      Can anybody help me?

      Thanks in advance

       

  6. Anonymous

    I've download JIRA source and I want to configure into eclipse. I suposse I have to import the project, but I don't know how to do it. Anybody can help me? Thanks!

  7. i've installed all the 3rd party libraries, including the activation jar. but whenever I build the application, it will always try to download the activation jar from maven repository, which is not exist.

    The build will stop and showed error, informing that there's a missing artifact. Anybody has any idea on how to solve this. Thanks

     

  8. I am a little confuse, this wiki page stated:

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

    (Download 'JMX 1.2.1 Reference Implementation')

    eventually lead me to http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-java-plat-419418.html#7657-jmx-1.2.1-oth-JPR, but there is no JMX 1.2.1 Reference Implementation, only 

    • Java Management Extension (JMX) 1.2.1: jmx-1_2_1-ri.zip 
    • Java Management Extensions 1.2 Reference Implementation: jmx-1_2-ri.zip

    Which one should I download? Reading further down the page, it indicating that you should use jmx-1_2_1-ri.zip.

    Please consider updating this wiki page to make it more clear.

  9. Anonymous

    Hi All,

    I am still facing this problem. is there any solution to this on windows.

    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] An Ant BuildException has occured: Javadoc failed: java.io.IOException: Cannot run program "C:\rw_apps\Java\jdk_1.6.0.30-x64\bin\javadoc.exe": CreateProcess error=206, The filename or extension is too long
  10. I also have a build problem as below. How to solve this error? Can anyone  help me?

    721K downloaded (jira-rest-plugin-6.0.4-20130701.231201.jar)
    [INFO] [enforcer:enforce {execution: enforce-build-environment}]
    [INFO] Skipping Rule Enforcement.
    [INFO] [buildnumber:create {execution: get-commit-id}]
    [INFO] Checking for local modifications: skipped.
    [INFO] Updating project files from SCM: skipped.
    [INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
    [INFO] Working directory: c:\atlassian-jira-6.0.6-source\project-templates-plugin
    [INFO] Storing buildNumber: unknown at timestamp: yyyy-MM-ddTHH:mm:ssZ
    [INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
    [INFO] Working directory: c:\atlassian-jira-6.0.6-source\project-templates-plugin
    [INFO] Storing buildScmBranch: UNKNOWN_BRANCH
    [INFO] [buildnumber:create-timestamp {execution: get-commit-id}]
    [INFO] [buildnumber:create {execution: get-short-commit-id}]
    [INFO] Checking for local modifications: skipped.
    [INFO] Updating project files from SCM: skipped.
    [INFO] ShortRevision tag detected. The value is '7'.
    [INFO] Executing: cmd.exe /X /C "git rev-parse --verify --short=7 HEAD"
    [INFO] Working directory: c:\atlassian-jira-6.0.6-source\project-templates-plugin
    [INFO] Storing buildNumber: unknown at timestamp: yyyy-MM-ddTHH:mm:ssZ
    [INFO] ShortRevision tag detected. The value is '7'.
    [INFO] Executing: cmd.exe /X /C "git rev-parse --verify --short=7 HEAD"
    [INFO] Working directory: c:\atlassian-jira-6.0.6-source\project-templates-plugin
    [INFO] Storing buildScmBranch: UNKNOWN_BRANCH
    [INFO] [jira:copy-bundled-dependencies]
    [INFO] [dependency:unpack-dependencies]
    [INFO] Unpacking c:\atlassian-jira-6.0.6-source\localrepo\com\atlassian\jira\plugins\jira-core-project-templates\2.13\jira-core-project-templates-2.13.jar to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes with includes "" and excludes "META-INF/MANIFEST.MF,META-INF/*.DSA,META-INF/*.SF"
    [INFO] Unpacking c:\atlassian-jira-6.0.6-source\localrepo\com\atlassian\jira\plugins\project-templates-api\2.13\project-templates-api-2.13.jar to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes with includes "" and excludes "META-INF/MANIFEST.MF,META-INF/*.DSA,META-INF/*.SF"
    [INFO] [jira:compress-resources]
    [INFO] Compiling javascript using YUI
    [INFO] compressing to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes\js\AddProjectController-min.js
    [INFO] compressing to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes\js\AddProjectView-test-min.js
    [INFO] compressing to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes\js\AddProjectView-min.js
    [INFO] compressing to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes\js\DialogController-test-min.js
    [INFO] compressing to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes\js\DialogController-min.js
    [INFO] compressing to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes\js\DialogView-min.js
    [INFO] compressing to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes\js\lib\jquery.dotdotdot-1.5.7-min.js
    [INFO] compressing to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes\js\ProjectKeyGenerator-min.js
    [INFO] compressing to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes\js\RemoteProjectsCreatedMessage-min.js
    [INFO] compressing to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes\js\SelectProjectTemplateController-min.js
    [INFO] compressing to c:\atlassian-jira-6.0.6-source\project-templates-plugin\target\classes\js\SelectProjectTemplateView-min.js
    [ERROR] unterminated string literal
    'remove' : [ ' ', ',', ';', '.', '!', '?', '?? ],
    [ERROR] syntax error
    'remove' : [ ' ', ',', ';', '.', '!', '?', '?? ],
    [ERROR] syntax error
    'noEllipsis' : []
    [ERROR] missing ; before statement
    });
    [ERROR] syntax error
    };
    [ERROR] Compilation produced 5 syntax errors.
    [INFO] ------------------------------------------------------------------------
    [ERROR] FATAL ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Compilation produced 5 syntax errors.
    [INFO] ------------------------------------------------------------------------
    [INFO] Trace
    org.mozilla.javascript.EvaluatorException: Compilation produced 5 syntax errors.
    at com.atlassian.maven.plugins.amps.util.minifier.YUIErrorReporter.runtimeError(YUIErrorReporter.java:35)
    at org.mozilla.javascript.Parser.parse(Parser.java:392)
    at org.mozilla.javascript.Parser.parse(Parser.java:337)
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
    at com.atlassian.maven.plugins.amps.util.minifier.ResourcesMinifier.yuiJsCompile(ResourcesMinifier.java:176)
    at com.atlassian.maven.plugins.amps.util.minifier.ResourcesMinifier.processJs(ResourcesMinifier.java:112)
    at com.atlassian.maven.plugins.amps.util.minifier.ResourcesMinifier.processResource(ResourcesMinifier.java:59)
    at com.atlassian.maven.plugins.amps.util.minifier.ResourcesMinifier.minify(ResourcesMinifier.java:38)
    at com.atlassian.maven.plugins.amps.MavenGoals.compressResources(MavenGoals.java:499)
    at com.atlassian.maven.plugins.amps.CompressResourcesMojo.execute(CompressResourcesMojo.java:33)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

  11. Hello,

    I've adapted the JNDI 1.2.1 you answered  but the same. what to do anything!

    I've got one question. how to uninstall the JNDI? what's the maven command? I want to reinstall the JNDI! 

    cheers!

    Kim

     

  12. Not being able to build the dependencies is not helpful. IMHO they need to be buildable, ie include the pom and the source code in the correct structure.

    Also is there a way of telling IDEA where the sources for the dependencies are, short of hooking them up one by one for each library? 

    1. +1 here. This is a good question! As an author of JFS plugin I now have a lot of trouble building a patched versions of streams plugin.