in java jira custom_plugin intelij_idea setup atlassian brew ~ read.

How to setup JIRA plugin Project in Intelij IDEA on Mac

As i said previously in my post i came to conclusion that i need to write my own custom JIRA plugin. To do that , we first need to setup project and make sure that it's possible to debug the code you write. I usually use Intelij IDEA for writing code in Java and Scala. It's really powerful IDE and you can get it for free if you choose Community Edition version. For automation engineer i find this option simply the best.
I must say that Atlassian did a very nice job in their manuals and process of setting up a project. Steps a very simple :

  • Check that your $JAVA_HOME variable is setup and you have JDK >= 1.6 installed on your machine. If not then take a look here

  • Install Atlassian SDK . You can do it in 2 ways :

    • Either Download installer and just go through installation steps
    • Or, if you're using brew on your mac, then you can do this in two commands :
brew tap atlassian/tap
brew install atlassian/tap/atlassian-plugin-sdk
  • Check that you have setup you SDK correctly. Run
atlas-version 

Since i'm using brew for installation, my output looks like this :

ATLAS Version:    5.0.4
ATLAS Home:       /usr/local/Cellar/atlassian-plugin-sdk/5.0.4/libexec
ATLAS Scripts:    /usr/local/Cellar/atlassian-plugin-sdk/5.0.4/libexec/bin
ATLAS Maven Home: /usr/local/Cellar/atlassian-plugin-sdk/5.0.4/libexec/apache-
maven-3.2.1
--------
Executing: 
/usr/local/Cellar/atlassian-plugin-sdk/5.0.4/libexec/apache-maven-3.2.1/bin/mvn

--version -gs 
/usr/local/Cellar/atlassian-plugin-sdk/5.0.4/libexec/apache-maven-3.2.1/conf/
settings.xml
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 
2014-02-14T18:37:52+01:00)
Maven home: 
/usr/local/Cellar/atlassian-plugin-sdk/5.0.4/libexec/apache-maven-3.2.1
Java version: 1.7.0_67, vendor: Oracle Corporation
Java home: 
/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre

If everything looks fine , then you are ready to create your new project:

  • Open terminal and go to directory where you want to store your project
  • Run atlas-create-jira-plugin command
  • Specify group, artifact id and hit Y
  • Open Intelij IDEA and click "Open"
  • Select folder where you created your stub for the project
  • Now, to be able to debug and build project, we need to modify maven properties for the project.
    • Open project settings and open Maven section.
    • Override maven home directory to
      /usr/local/Cellar/atlassian-plugin-sdk/5.0.4/libexec/apache-maven-3.2.1
    • Override user settings file to /usr/local/Cellar/atlassian-plugin-sdk/5.0.4/libexec/apache-maven-3.2.1/conf/settings.xml
    • Override local repository to /usr/local/Cellar/atlassian-plugin-sdk/5.0.4/libexec/repository
    • Save your changes

Now you are ready to start developing new JIRA plugin. I will describe how to create a plugin that will send an e-mail on custom field change in the next post.

comments powered by Disqus
comments powered by Disqus