JIRA Standalone quick source modifications

JIRA Documentation

Index

To make any substantial modifications or additions to JIRA's source, you should read the documentation on building JIRA from source. This implies building a .war, and deploying this to your own app server. However to make a small code modification/addition to a JIRA Standalone, there is a quicker way:

  1. Download and install Apache Ant
  2. Find JIRA Standalone's external-source directory, and create a src directory beneath.
  3. In external-source/src, add your new .java file, or modified copy of an existing JIRA .java file.
  4. Run 'ant' in external-source

For instance, to modify the FogBugz importer to use a different user mapper (sed replaces references from the default mapper to our CustomUserMapper, which can then be edited for custom behaviour):

jturner@teacup:/tmp/atlassian-jira-enterprise-3.6.5-standalone$ mkdir external-source/src
jturner@teacup:/tmp/atlassian-jira-enterprise-3.6.5-standalone$ cp ../atlassian-jira-enterprise-3.6.5-source/jira/src/java/com/atlassian/jira/imports/fogbugz/FogBugzConfigBean.java external-source/src/
jturner@teacup:/tmp/atlassian-jira-enterprise-3.6.5-standalone$ cp ../atlassian-jira-enterprise-3.6.5-source/jira/src/java/com/atlassian/jira/imports/csv/mappers/FirstInitialFirstNameUserMapper.java external-source/src/CustomUserMapper.java
jturner@teacup:/tmp/atlassian-jira-enterprise-3.6.5-standalone$ sed -ie 's/FirstInitialFirstNameUserMapper/CustomUserMapper/g' external-source/src/*.java
jturner@teacup:/tmp/atlassian-jira-enterprise-3.6.5-standalone$ cd external-source/
jturner@teacup:/tmp/atlassian-jira-enterprise-3.6.5-standalone/external-source$ ant
Buildfile: build.xml

prepare:
[mkdir] Created dir: /tmp/atlassian-jira-enterprise-3.6.5-standalone/external-source/etc
[mkdir] Created dir: /tmp/atlassian-jira-enterprise-3.6.5-standalone/external-source/lib

compile:
[javac] Compiling 2 source files to /tmp/atlassian-jira-enterprise-3.6.5-standalone/atlassian-jira/WEB-INF/classes
[javac] Note: /tmp/atlassian-jira-enterprise-3.6.5-standalone/external-source/src/FogBugzConfigBean.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.

BUILD SUCCESSFUL
Total time: 2 seconds
jturner@teacup:/tmp/atlassian-jira-enterprise-3.6.5-standalone/external-source$

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.