Documentation : Using the AMPS Maven Plugin Directly

The Atlassian Plugin SDK is built on top of the Atlassian Maven Plugin Suite (AMPS). AMPS extends the Maven build environment specifically for developing Atlassian plugins. When you create a project with the Atlassian Plugin SDK, AMPS is automatically configured as the build environment for your project.

This page provides more information about AMPS. You won't normally need to use AMPS directly, since the Atlassian Plugin SDK wraps AMPS commands with its own script-style commands. However, in some cases, you may wish to invoke AMPS commands directly or specify configuration settings for AMPS, which you can do in the project POM.

For information on configuring AMPS settings, see AMPS Build Configuration Reference.

AMPS Architecture

AMPS is a suite of Maven plugins. AMPS combines multiple plugins, conventions, and POM configuration.

Diagram: AMPS architecture:

The product-specific configuration is as follows:

Product

AMPS plugin

Bamboo

bamboo-maven-plugin

Bitbucketbitbucket-maven-plugin

Confluence

confluence-maven-plugin

Crowd

crowd-maven-plugin

Fisheye/Crucible

fecru-maven-plugin

Jira

jira-maven-plugin

Refapp

refapp-maven-plugin

Basic Commands

The commands are of the form mvn APPLICATION:CMD, where:

  • APPLICATION is the short name of the product plugin above;
  • CMD is one of the commands listed below.

Examples:

  • mvn confluence:run
  • mvn confluence:create
  • mvn jira:run
  • mvn jira:debug

In the table below, replace APPLICATION with the name of Atlassian product for which you are developing a plugin. Fisheye and Crucible use the same plugin, so APPLICATION should be replaced with fecru if you are developing for either of them.

APPLICATION:create

Create a plugin skeleton from a Maven archetype, specific to the Atlassian product for which you are developing.
Examples: mvn confluence:create or mvn jira:create

APPLICATION:run

Download the product binaries (if not already downloaded), install your plugin, start the product in a Tomcat container with your deployed plugin.
Examples: mvn confluence:run or mvn jira:run

APPLICATION:debug

As for `APPLICATION:run`, but with remote debugging enabled.

APPLICATION:integration-test

Start the product in a Tomcat container, run all it/** integration tests, then shut down the product.

APPLICATION:unit-test

Run the unit tests, excluding it/**.

APPLICATION:create-home-zip

Creates a zip of the current application's data which can be used in future runs of the SDK.

APPLICATION:copy-bundled-dependencies

Copy all runtime and compile-scoped dependencies into META-INF/lib.

APPLICATION:install

Install your plugin (via the PDK).

APPLICATION:uninstall

Uninstall your plugin (via the PDK).

Examples

This section describes how to run the following commands:

Creating a New Confluence Plugin from Scratch

Say you want to create a new Confluence plugin skeleton. Simply go to the directory where you want to create the plugin and type:

1
2
mvn confluence:create

Running a Plugin in an Application

Say you wanted to run an arbitrary plugin in Confluence. Simply go to the plugin's project directory and type:

1
2
mvn confluence:run

Specifying a Version of the Application

Say you wanted to run your plugin with Confluence 7.13:

1
2
mvn confluence:run -Dproduct.version=7.13.0

Say you want to run your plugin with Jira 8.19:

1
2
mvn jira:run -Dproduct.version=8.19.0

Specifying an application server (container)

Say you wanted to run that plugin but with Confluence 7.13 and Tomcat 8:

1
2
mvn confluence:run -Dproduct.version=7.13.0 -Dcontainer=tomcat8x

Running your plugin in debug mode from your IDE

Say you wanted to run that plugin in debug mode from your IDE. Set up a configuration in IDEA that executes from the project directory:

1
2
mvn confluence:run -Dcontainer=jetty6x

Writing integration tests

Say you wanted to write a new plugin for Confluence, with integration tests, but with minimal POM XML and without extending any other POM:

1
2
<packaging>confluence-plugin</packaging>
...
<plugin>
  <groupId>com.atlassian.maven.plugins</groupId>
  <artifactId>confluence-maven-plugin</artifactId>
  <extensions>true</extensions>
</plugin>

Running integration tests against a different product

Say you had a Refapp plugin, but wanted to run your integration tests against Confluence:

1
2
mvn package confluence:integration-test

Running your plugin in multiple products

Say you want to run the plugin in multiple products simultaneously. In three separate tabs in your terminal (command window), type:

1
2
mvn refapp:run

mvn confluence:run -Dproduct.version=7.13.0

mvn jira:run -Dproduct.version=8.19.0

You can now test your plugin on three products side by side in your browser. This also means you can redeploy your plugin simultaneously:

1
2
mvn package confluence:install refapp:install

Specifying a Version of AMPS

The short form of the mvn APPLICATION:run or mvn APPLICATION:create command will use the latest version of the AMPS plugins. If you want to get a specific version of an AMPS command, use the longer form of the command. For example:
mvn com.atlassian.maven.plugins:confluence-maven-plugin:8.2.3:create

AMPS Build Configuration Reference

Rate this page: