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:
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:
On the next dialog, select “Import Project from external model”, select Maven and click on Next:
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):
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.
The next dialog is trivial in comparison, I normally select the defaultProfile option (your mileage may vary):
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):
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:
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:
Your project will now open in the IDE. Let’s verify our Run configuration by selecting the Run -> Edit Configurations menu option:
If you don’t see the Maven option, but only the Defaults, click on the + to add the configuration:
The General parameters should be similar to the following:
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.
Congratulations, you should be able to Build and Run your plugin from within the IDE.
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.
BY: SOFTWARE DEVELOPER AT INFOWARE STUDIOS
Interesting Infoware Studios Bookmarks
- See my delicious