How to import a jira plugin project in intellji idea

There is some documentation on the Atlassian SDK web site on how to import a JIRA plugin project into Intellji IDEA, but I’ve found that the described steps are lacking some important details.

Creating a jira plugin

First of all, create the plugin with the normal command line command:

atlas-create-jira-plugin

 We can now import the project into IDEA (the following steps were completed with Intellji IDEA 13).

Importing the jira plugin into IDEA

Select the File -> Import Project option or click on the Import Project link on the “Welcome to Intellji IDEA” dashboard. There are no less than eight dialogs to work through (given that we’ll select to use maven as an external model during the process).

Let’s import our project! 

Browse to the project to be imported (note: do not select the pom.xml file inside the folder, but rather the folder name itself), and click on OK:

How to import a jira plugin project in intellji idea - 01

On the next dialog, select “Import Project from external model”,  select Maven and click on Next:

How to import a jira plugin project in intellji idea - 02

The next dialog contains all the Maven options, sticking to the defaults should be fine  (I’ve selected “Import Maven projects automatically” as well). But before you click on Next to proceed to the next step, open the Maven settings by clicking on Environment settings (just above the Previous and Next links):

How to import a jira plugin project in intellji idea - 03

On the Maven environment dialog, select override next to the Maven home directory, and browse to your atlassian-plugin-sdk folder. In my case (on a Mac OS X), it’s /usr/share/atlassian-plugin-sdk-4.2.12/apache-maven.

How to import a jira plugin project in intellji idea - 04

The next dialog is trivial in comparison, I normally select the defaultProfile option (your mileage may vary):

How to import a jira plugin project in intellji idea - 05

You should now see the Maven project to import (selecting “Open Project Structure after import” is not a bad idea either, although I haven’t done it when capturing these screen shots):

How to import a jira plugin project in intellji idea - 06

We are now almost done, now select the relevant project SDK (I’m using my notebook for Ruby development as well, hence the RVM options shown in the dialog).  I’ve select the 1.6.0.jdk option:

How to import a jira plugin project in intellji idea - 07

And now for the final import step (we still have some configuration settings to verify after this), enter the Project name (this option will most likely be filled in automatically) and click on Finish:

How to import a jira plugin project in intellji idea - 08

Your project will now open in the IDE.  Let’s verify our Run configuration by selecting the Run -> Edit Configurations menu option:

How to import a jira plugin project in intellji idea - 09

If you don’t see the Maven option, but only the Defaults, click on the + to add the configuration:

How to import a jira plugin project in intellji idea - 10

The General parameters should be similar to the following:

How to import a jira plugin project in intellji idea - 12

And finally, verify the Runner configuration settings. If you unselect the “Use project settings”, you should be able to set the VM options as follows:

-Xms32m -Xmx256m -XX:MaxPermSize=128m -ea

 And the JRE should be set to “Use Project JDK”, which is 1.6 in my case.

How to import a jira plugin project in intellji idea - 13

Congratulations, you should be able to Build and Run your plugin from within the IDE.

Development workflow 

There are a number of options for development workflow:
[list_icon color=”blue” type=”icon_arrow”]

  • Compile and run JIRA with your plugin from within  the IDE.
  • Compile within the IDE, but use the command line to run JIRA with your plugin.
  • Compile within the IDE, but build the plugin .jar file and upload it manually to your JIRA instance.

[/list_icon]
Each option has its pros and cons, it comes to personal preference at the end of the day (although you will have to build (package) at some stage of the plugin development lifecycle).


BY: SOFTWARE DEVELOPER AT INFOWARE STUDIOS


Enhanced by Zemanta

Interesting Infoware Studios Bookmarks

0
  Related Posts