Create a HelloWorld Plugin Project
You now have a local development environment configured for the Atlassian SDK and you're ready to build your first plugin!
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.
On this page:
Step 1. Use the Atlassian SDK to build a plugin skeleton
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
atlas-create-jira-plugincommand 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:
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:
The basic skeleton for your Atlassian JIRA plugin is created in a new
. ├── 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.
Step 2. Start up JIRA with your plugin installed
In this step, we'll use the
atlas-run 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
myPlugindirectory 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:
Open a browser window and navigate to http://localhost:2990/jira. To login, use the credentials:
Username admin Password admin
- 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
- 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.
You have a basic plugin skeleton, so lets learn how to modify and customise it to provide a new menu in JIRA.