Documentation for JIRA 6.4 (This documentation includes the project navigation sidebar). Not using this? See below:
(JIRA 6.4 without sidebar documentation | JIRA 6.3.x documentation | JIRA Cloud documentation | earlier versions of JIRA)

Skip to end of metadata
Go to start of metadata

To make any substantial modifications or additions to JIRA's source, you should read Building JIRA from Source. This implies building a WAR and deploying this to your Application Server.

Making a Single Class Patch

This guide describes how to make a source code modification to a single class file.

  1. Download Maven 2.1.0 from the Apache archives of the Maven website.
  2. Set your PATH and M2_HOME environment variables where you install Maven (and its /bin directory for the PATH).
    (tick) Refer to the Building JIRA from Source documentation for details.
  3. Download JIRA source.
  4. Changed directory into your extracted JIRA source directory and then into its jira-project subdirectory.
  5. Run one of the following, depending on your preferred IDE:

    OR

  6. Open the resulting project.
  7. From your IDE, build the project.
  8. From your IDE, open and compile a file. The compiled file will appear in the target/classes directory of the maven module that you are working on. If you are working with JIRA's core classes, this is likely to be in /jira-project/jira-components/jira-core/target/classes

Deploying the Patch

To deploy a patch, drop the file in the classpath from <jira-install>/WEB-INF/classes. For example, if you compile the class:

...it will be available from:

To deploy this class, place it in:

...then restart JIRA.

20 Comments

  1. When I do this I get an error that says:

    -------------------------------------------------------------------------------
    >> Error parsing project.xml 'C:\DemandwareStudio\workspace\atlassian\jira\project.xml'
    >> ParseError at [row,col]:[1629,28]
    Message: Unrecognised tag: 'm2-transitive'
    -------------------------------------------------------------------------------

    Mind you, I actually have maven 2 also installed. I can get it to build the project at the top of the source tree just fine. Also, this eclipse doesn't allow you create projects that are multiple layers under the workspace, so I don't know how you're supposed to keep the JIRA project tree intact.

    1. Hi Tyrin,

      I've posted a bug report with solution at JRA-20160.

  2. Can I just replace the compiled class in my installation or do I need to put it in the patch directory, similar to JIRA patches?

    1. I've updated the page to describe how to deploy it. It goes in the classpath in the /classes directory.

  3. Anonymous

    Hi,

    I need to edit the Jira 'Importer Source Code' specifically 'BugzillaImportBean.Java' - http://confluence.atlassian.com/display/JIRA040/Importing+Data+from+Bugzilla

    I want ot edit Bugzilla to Jira mappings upon import, I have insalled Maven 1.0.1 and Maven 2.2.1. I've downloaded atlassian-jira-enterprise-4.0.1-source.

    After running "maven war:webapp". I get a lot of errors in maven.xml file.

    I tried ignoring the error and continue, I ran "maven idea" and opened project in [IntelliJ IDEA Community Edition 9.0.3]. After building the project I get a lot of errors due to missing classes.

    I dont know what's wrong, please help me and point me to the right direction. Thanks

    1. Make sure to correct project.xml if you're getting the parse error above. I've updated the page with some maven 2 instructions as well, as that's now included in the source distribution.

      1. Anonymous

        Hi Jeremy,

        I tried the solution at JRA-20160 but my errors still exist.

        The problem is upon running "maven war:webapp"; it prompts 'BUILD FAILED' and the error is in maven.xml file.

        Can I know exactly what maven versions, idea versions, and jira versions this patch steps is confirmed working?

        1. Please give a try in our forums. We'll need to know your exact error message and troubleshoot from there.

  4. If you get a 'Failed to resolve artifact', try downloading the jar files directly: https://m2proxy.atlassian.com/repository/m1/

    You can download them, then use the syntax in the error messages to get past this hurdle.

    Another tip - using this settings.xml (it's in your ~/.m2 folder) might help from Example settings.xml.

    1. Anonymous

      Hi Jeremy,

       

      I am trying to build the JIRA 5.0 source from Netbeans 7.0.1. It's giving many errors for missing Jar files. I manually downloaded them(more than 50)  and trying to build the project.

      Even though, I have created a directory(atlassian-i18n-upsidedown-text-maven-plugin) and downloaded these jar,pom files, it's still showing this error. I want to make changes for Mail handler class and customize for  out company requirement.

       Please help to build the code.

       

      [INFO] [antlr3:antlr {execution: default}]
      [INFO] ANTLR: Processing source directory C:\atlassian-jira-5.0-source\atlassian
      -jira-5.0-source\jira-project\jira-components\jira-core\src\main\antlr3
      ANTLR Parser Generator Version 3.1.3 Mar 17, 2009 19:23:44
      Grammar com\atlassian\jira\jql\parser\antlr\Jql.g is up to date - build skipped
      [INFO] [netbeans-freeform:generate-netbeans-project]
      [INFO] JarAnalyser found
      [INFO] The project 'Atlassian JIRA - Code - Core' is analysed.
      [INFO] The file 'nbproject/project.xml' is created.
      [INFO] The file 'nbproject/mavencall.xml' is created.
      [INFO] The file 'nbproject/project.properties' is created.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Atlassian JIRA - Language Packs
      [INFO] task-segment: [netbeans-freeform:generate-netbeans-project]
      [INFO] ------------------------------------------------------------------------
      [INFO] Preparing netbeans-freeform:generate-netbeans-project
      Downloading: http://repo1.maven.org/maven2/com/atlassian/maven/plugins/atlassian
      -i18n-upsidedown-text-maven-plugin/1.1/atlassian-i18n-upsidedown-text-maven-plug
      in-1.1.pom
      [INFO] Unable to find resource 'com.atlassian.maven.plugins:atlassian-i18n-upsid
      edown-text-maven-plugin:pom:1.1' in repository central (http://repo1.maven.org/m
      aven2)
      Downloading: http://repo1.maven.org/maven2/com/atlassian/maven/plugins/atlassian
      -i18n-upsidedown-text-maven-plugin/1.1/atlassian-i18n-upsidedown-text-maven-plug
      in-1.1.pom
      [INFO] Unable to find resource 'com.atlassian.maven.plugins:atlassian-i18n-upsid
      edown-text-maven-plugin:pom:1.1' in repository central (http://repo1.maven.org/m
      aven2)
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Error building POM (may not be this project's POM).


      Project ID: com.atlassian.maven.plugins:atlassian-i18n-upsidedown-text-maven-plu
      gin

      Reason: POM 'com.atlassian.maven.plugins:atlassian-i18n-upsidedown-text-maven-pl
      ugin' not found in repository: Unable to download the artifact from any reposito
      ry

      com.atlassian.maven.plugins:atlassian-i18n-upsidedown-text-maven-plugin:pom:1.
      1

      from the specified remote repositories:
      central (http://repo1.maven.org/maven2)

      for project com.atlassian.maven.plugins:atlassian-i18n-upsidedown-text-maven-pl
      ugin


      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 30 seconds
      [INFO] Finished at: Mon Apr 02 08:28:57 EDT 2012
      [INFO] Final Memory: 54M/131M
      [INFO] ------------------------------------------------------------------------
      C:\atlassian-jira-5.0-source\atlassian-jira-5.0-source\jira-project>

       

       

      Thanks in advance...

       

  5. JIRA 4.3.3 source, error when running eclipse:eclipse goal:

    For a workaround see: http://forums.atlassian.com/thread.jspa?threadID=34952

  6. Anonymous

    Guys,

     

    i'm having problem with source from JIRA 5.0.6. I'm getting this erros:

    [WARNING] Unable to get resource 'com.atlassian.jira:jira-bundled-plugins:zip:5
    0.6' from repository central (http://repo1.maven.org/maven2): Error transferrin
    file: repo1.maven.org
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Failed to resolve artifact.

    Missing:
    ----------
    1) com.atlassian.jira:jira-bundled-plugins:zip:5.0.6

    Try downloading the file manually from the project website.

    Then, install it using the command:
    mvn install:install-file -DgroupId=com.atlassian.jira -DartifactId=jira-b
    ndled-plugins -Dversion=5.0.6 -Dpackaging=zip -Dfile=/path/to/file

    Alternatively, if you host your own repository you can deploy the file there:

    mvn deploy:deploy-file -DgroupId=com.atlassian.jira -DartifactId=jira-bun
    led-plugins -Dversion=5.0.6 -Dpackaging=zip -Dfile=/path/to/file -Durl=[url] -D
    epositoryId=[id]

    Path to dependency:
    1) com.atlassian.jira:atlassian-jira-webapp:war:5.0.6
    2) com.atlassian.jira:jira-bundled-plugins:zip:5.0.6

    ----------
    1 required artifact is missing.

    for artifact:
    com.atlassian.jira:atlassian-jira-webapp:war:5.0.6

    from the specified remote repositories:
    atlassian-plugin-sdk (file://C:\workspace-atlassian\atlassian-plugin-sdk-3.9.
    /repository),
    central (http://repo1.maven.org/maven2),
    atlassian-public (https://m2proxy.atlassian.com/repository/public)

     

    Someone can help me?

     

    Thanks.

  7. This seems very complex. I just go the external-source directory, mkdir src etc lib, copy the existing Foo*.class files to somewhere safe, copy the source file I want to compile to my new src directory and run ant. Very fast, very easy.

  8. I have tried modifying a singular class file - IssuesProjectTabPanel, after doing so I perform a recompile and copy the newly created class file to the classpath in JIRA Standalone. Nothing changes inside the Browse Project window on JIRA. I commented the line //frags.add(unresolvedIssuesByAssigneeFragment); so as not to display the unresolved by assignee list - this was a test. What am I doing wrong at this point ? any help would be much appreciated. I have followed this process https://answers.atlassian.com/questions/59189/hide-unresolved-by-assignee-field-on-issues-tab-from-project-panels-plugin but it does not work.

      1. After rebuilding my dev environment, I have successfully managed to hide areas of the IssuesProjectTabPanel as a test, thanks for the help so far. Just a quick question is it possible to add "authorization logic" by performing a group membership check at showpanel()

        I've tried to perform this check as below – Is this possible or should I be looking at the vm templates instead ?

        public boolean  showPanel(User user,DefaultGroupManager GroupManager, BrowseContext ctx)

            {

        if  ( user != null  )             

        return  GroupManager.isUserInGroup("user", "jira-developers");          

        return  false ;    } 

         

        This does not work at present, most likely since I cannot retrieve the "user" value string, unlss I shopuld be importing another crowd package into the class to enable this ability.

  9. Anonymous

    when i build source i am getting this error:

    JIRA version is:5.0.2

    Downloading: http://repo1.maven.org/maven2/com/atlassian/maven/plugins/sandbox-maven-plugin/2.1-beta11/sandbox-maven-plugin
    1-beta11.pom
    [INFO] Unable to find resource 'com.atlassian.maven.plugins:sandbox-maven-plugin:pom:2.1-beta11' in repository central (htt
    /repo1.maven.org/maven2)
    Downloading: http://repo1.maven.org/maven2/com/atlassian/maven/plugins/sandbox-maven-plugin/2.1-beta11/sandbox-maven-plugin
    1-beta11.pom
    [INFO] Unable to find resource 'com.atlassian.maven.plugins:sandbox-maven-plugin:pom:2.1-beta11' in repository central (htt
    /repo1.maven.org/maven2)
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Error building POM (may not be this project's POM).


    Project ID: com.atlassian.maven.plugins:sandbox-maven-plugin

    Reason: POM 'com.atlassian.maven.plugins:sandbox-maven-plugin' not found in repository: Unable to download the artifact fro
    ny repository

      com.atlassian.maven.plugins:sandbox-maven-plugin:pom:2.1-beta11

    from the specified remote repositories:
      central (http://repo1.maven.org/maven2)

     for project com.atlassian.maven.plugins:sandbox-maven-plugin


    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 8 seconds
    [INFO] Finished at: Tue Oct 23 17:20:51 IST 2012
    [INFO] Final Memory: 11M/20M
    [INFO] ------------------------------------------------------------------------
    C:\data-rams\atlassian-jira-5.0.2-source.tar\atlassian-jira-5.0.2-source\jira-project>

  10. Anonymous

    I have the source code and I want to build into the eclipse ide, but I don't know very well how. I have read that I have to run "mvn eclipse:eclipse", but into what directory, into the jira-project subdirectory, isn't it?

    I have the following error:

    F:\atlassian-jira-5.2-m06-2-source\jira-project>mvn eclipse:eclipse
    [INFO] Scanning for projects...
    Downloading: http://repo1.maven.org/maven2/com/atlassian/pom/atlassian-closeds
    rce-pom/25/atlassian-closedsource-pom-25.pom
    [INFO] Unable to find resource 'com.atlassian.pom:atlassian-closedsource-pom:p
    :25' in repository central (http://repo1.maven.org/maven2)
    [INFO] -----------------------------------------------------------------------
    [ERROR] FATAL ERROR
    [INFO] -----------------------------------------------------------------------
    [INFO] Error building POM (may not be this project's POM).


    Project ID: com.atlassian.jira:jira-project:pom:5.2-m06-2

    Reason: Cannot find parent: com.atlassian.pom:atlassian-closedsource-pom for p
    ject: com.atlassian.jira:jira-project:pom:5.2-m06-2 for project com.atlassian.
    ra:jira-project:pom:5.2-m06-2


    [INFO] -----------------------------------------------------------------------
    [INFO] Trace
    org.apache.maven.reactor.MavenExecutionException: Cannot find parent: com.atla
    ian.pom:atlassian-closedsource-pom for project: com.atlassian.jira:jira-projec
    pom:5.2-m06-2 for project com.atlassian.jira:jira-project:pom:5.2-m06-2
            at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:272)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
            at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java
    0)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp
    java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
    sorImpl.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:43

            at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find pare
    : com.atlassian.pom:atlassian-closedsource-pom for project: com.atlassian.jira
    ira-project:pom:5.2-m06-2 for project com.atlassian.jira:jira-project:pom:5.2-
    6-2
            at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage
    efaultMavenProjectBuilder.java:1396)
            at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(D
    aultMavenProjectBuilder.java:823)
            at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSource
    leInternal(DefaultMavenProjectBuilder.java:508)
            at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMa
    nProjectBuilder.java:200)
            at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:604)
            at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:487
            at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
            ... 12 more
    Caused by: org.apache.maven.project.ProjectBuildingException: POM 'com.atlassi
    .pom:atlassian-closedsource-pom' not found in repository: Unable to download t
     artifact from any repository

      com.atlassian.pom:atlassian-closedsource-pom:pom:25

    from the specified remote repositories:
      central (http://repo1.maven.org/maven2)

     for project com.atlassian.pom:atlassian-closedsource-pom
            at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRe
    sitory(DefaultMavenProjectBuilder.java:605)
            at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage
    efaultMavenProjectBuilder.java:1392)
            ... 18 more
    Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unabl
    to download the artifact from any repository

      com.atlassian.pom:atlassian-closedsource-pom:pom:25

    from the specified remote repositories:
      central (http://repo1.maven.org/maven2)


            at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(
    faultArtifactResolver.java:228)
            at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(
    faultArtifactResolver.java:90)
            at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRe
    sitory(DefaultMavenProjectBuilder.java:558)
            ... 19 more
    Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to dow
    oad the artifact from any repository
            at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(D
    aultWagonManager.java:404)
            at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(
    faultArtifactResolver.java:216)
            ... 21 more
    [INFO] -----------------------------------------------------------------------
    [INFO] Total time: 1 second
    [INFO] Finished at: Thu Nov 22 10:14:48 CET 2012
    [INFO] Final Memory: 1M/4M
    [INFO] -----------------------------------------------------------------------

    1. Anonymous

      Had the same problem with the atlassian-closedsource-pom. After hours of searching I could resolve this by downloading the settings.xml on this page: https://developer.atlassian.com/display/BAMBOODEV/Building+a+Bamboo+War+Distribution+From+Source and put it into the <USER_DIR>\.m2 directory.

      1. Anonymous

        Thank you for posting this response, you saved me from solving this problem the long way.

        It should be noted that the settings.xml file that is attached to that page has a funky extension on it that needs to be removed (settings.xml.devnet should rename to settings.xml).