Create a plugin skeleton
This section covers creating a plugin skeleton and launching it in the Atlassian Reference Application (RefApp). RefApp is a lightweight web application built for the sole purpose of developing plugins that work in any Atlassian application. If your plugin works in RefApp, you can run it in any other Atlassian application.
This section of the tutorial walks you through the following topics:
Get introduced to RefApp
We use RefApp intentionally in this tutorial. RefApp is a tool uniquely suited to plugin development: No Atlassian application is identical, but the RefApp provides the shared framework between all Atlassian applications. This means that you can develop your plugin without accidentally relying on dependencies or features specific to one application, or encountering an application-specific bug later on. Developing a plugin with RefApp eliminates guesswork about the functionality of your project. You can rest assured that since all Atlassian applications share at least the framework present in RefApp, your plugin will work as expected.
RefApp features common components like SAL (Secure access layer) or the REST API browser (we won't be using REST in this tutorial).
While the RefApp might not be much to look at, it's the perfect place to start your plugin development:
Step 1. Create a skeleton
Here, you'll create the foundation for your plugin project in the form of a plugin skeleton. Maven builds the plugin skeleton as Java and XML files, and downloads dependencies necessary for your plugin project.
Create a directory called
Change to your new
Generate a skeleton for your add-on.
Create the following when prompted.
enterto accept default values shown in brackets.
Confirm your entries when prompted with
The code generation runs to completion. You'll see a message similar to the following:
Change to the newly created
Remove the test directories.
These directories are automatically created from
atlas-create-refapp-plugin, but testing isn't part of this tutorial. Removing them simplifies your work in future steps.
Remove Java classes from the
You'll create a single Java class encapsulating your plugin logic in later steps.
Step 2. Start up the RefApp
When you generated the skeleton for your plugin, you specified a RefApp plugin skeleton. Your plugin has access to the shared application services and developer tools for all Atlassian applications. Here you'll start up the RefApp and get better acquainted with your resources.
Change directory to your project root.
Enter the following command to start up RefApp:
Locate the RefApp URL.
After a few moments your terminal will display a message with the URL of the application. RefApp usually launches on port 5990.
- Copy the URL and paste it into your browser.
- The URL will resemble http://localhost:5990/refapp.
- Click Login from the upper right-hand corner.
- Log in with the username
adminand the password
- Click Login.
- Click A.D. Ministrator (Sysadmin).
Under the General, Application Links, and Developer Toolbox you'll see the core components shared by all Atlassian applications:
Optional: Import your project into Eclipse IDE
You've launched RefApp from your
adminUI project root using just the command line. Now, let's import
adminUI into Eclipse so you can make code changes more easily.
Start from a new tab in your terminal:
Change directory to your project root.
Make your project available to Eclipse.
You can open a new tab in your terminal and run the following commands to open Eclipse.
- Click File > Import.
- Under General, choose Existing Projects into Workspace.
- Click Next.
- Choose Select root directory.
- Click Browse.
- Choose your project's parent directory,
- Click Open.
- Confirm your
adminUIproject appears in the Projects window.
If you don't see your project, ensure you run
atlas-mvn eclipse:eclipsewhile in your
- Click Finish.
Now that your plugin skeleton is built and imported into Eclipse, you'll construct a servlet.