Rate this page:
You now have a local development environment configured for the Atlassian SDK and you're ready to build your first Atlassian Server plugin!
Important: This guide explains how to build a plugin for Atlassian Server. If you meant to developing an app for Atlassian Cloud then view the JIRA Cloud Getting Started guide.
The plugin is going to be fairly simple, but you'll learn the fundamental steps for creating a plugin and starting up your application environment.
If you get stuck at any point, you can compare your progress to our myPlugin source code. The tutorial is tested to work with the Atlassian Plugin SDK 6.2.9.
Navigate to the directory on your system where you'd like to create your plugin. The command we are about to run will create a folder with the plugin directories inside.
Create an add-on project using the command from a **Command Prompt **window:
This command is going to build a JIRA plugin skeleton using maven. Some logs appear on the screen showing maven commands that are being run and the version of JIRA that is being used.
You will be prompted to provide some information about your plugin. For the purposes of this tutorial respond to the prompts as follows:
Define value for groupId: : com.atlassian.tutorial Define value for artifactId: : myPlugin Define value for version: 1.0.0-SNAPSHOT: : 1.0.0-SNAPSHOT Define value for package: com.atlassian.tutorial: : com.atlassian.tutorial.myPlugin
You will then be prompted to confirm your configuration. Verify the details to ensure they are correct, and then type Y once you are ready to proceed:
Confirm properties configuration: groupId: com.atlassian.tutorial artifactId: myPlugin version: 1.0.0-SNAPSHOT package: com.atlassian.tutorial.myPlugin Y: : Y
The basic skeleton for your Atlassian JIRA plugin is created in a new directory:
. ├── LICENSE ├── README ├── pom.xml └── src ├── main │ ├── java │ │ └── com │ │ └── atlassian │ │ └── tutorial │ │ └── myPlugin │ │ ├── api │ │ │ └── MyPluginComponent.java │ │ └── impl │ │ └── MyPluginComponentImpl.java │ └── resources │ ├── META-INF │ │ └── spring │ │ └── plugin-context.xml │ ├── atlassian-plugin.xml │ ├── css │ │ └── myPlugin.css │ ├── images │ │ ├── pluginIcon.png │ │ └── pluginLogo.png │ ├── myPlugin.properties │ └── js │ └── myPlugin.js └── test ├── java │ ├── it │ │ └── com │ │ └── atlassian │ │ └── tutorial │ │ └── myPlugin │ │ └── MyComponentWiredTest.java │ └── ut │ └── com │ └── atlassian │ └── tutorial │ └── myPlugin │ └── MyComponentUnitTest.java └── resources └── atlassian-plugin.xml
Feel free to take a moment to explore the different files created by the Atlassian SDK before you continue.
In this step, we'll use the command to run the application (JIRA in this example) and install the plugin. Then we'll confirm that JIRA has started with the plugin created in Step 1 already installed.
Change to the directory and enter the following command:
This is going to use the information in the plugin skeleton you created earlier to download JIRA and all of the other plugins it needs, then start JIRA with your plugin installed.
The first time you do this, it might take several minutes to complete.
Once JIRA has started, you'll see something like this in the Command Prompt window:
[INFO] [talledLocalContainer] Aug 08, 2016 5:51:33 PM org.apache.catalina.startup.Catalina start [INFO] [talledLocalContainer] INFO: Server startup in 234207 ms [INFO] [talledLocalContainer] Tomcat 8.x started on port  [INFO] jira started successfully in 332s at http://DESKTOP-EF2CA9N:2990/jira [INFO] Type Ctrl-D to shutdown gracefully [INFO] Type Ctrl-C to exit
Open a browser window and navigate to localhost:2990/jira. To login, use the credentials:
A Welcome dialog will appear and you'll be asked to configure some basic JIRA settings.
You'll only need to do this once for your plugin and the settings will be remembered the next time you use the command.
Type gg, and then type manage.** **From the list that appears, select Manage add-ons.
(Alternatively you can click on the cog icon at the top of the screen to open the administration dialog, and then select Add-ons and finally when the Atlassian Marketplace Administration page opens, select Manage add-ons on the right hand side).
Locate the myPlugin listings in User-installed add-ons and click on them to expand.
One of the listings you see will be the plugin itself, the other will be the plugin tests. Notice that the plugins have a few basic modules that were created by the SDK.
Close your browser, and return to the Command Prompt window where JIRA was running.
Shutdown JIRA gracefully with CTRL+D (on OSX and Linux) or CTRL+Z (on Windows).
You have a basic plugin skeleton, so lets learn how to modify and customise it to provide a new menu in JIRA.
The source code for this tutorial is available on Bitbucket at bitbucket.org/serverecosystem/myplugin
Alternatively, check out the Getting Started Tutorial FAQ
Still need help? Request support at Developer Technical Support Portal
Rate this page: