Working with the POM
This page describes the Project Object Model (POM) file generated by the SDK.
When you use the Atlassian Plugin SDK to create a plugin project, the SDK generates a Maven POM file for your project based on values you provided when running the create plugin script. Similarly, when you add modules to the project using the SDK, the SDK makes the corresponding changes to the POM files, for example, adding dependency declarations.
If you are just starting plugin development, it's helpful to understand how the POM works and how the SDK generates it. For simple or test projects, you may not need to modify the POM directly. However, most projects will require you to modify the POM yourself. Typically, you would do so to take advantage of Maven features outside the scope of the SDK functions, to customize build or Maven settings, or to specify dependencies manually.
Example of the SDK-Generated POM
The following listing shows a POM generated by the SDK. This POM happens to be for a Confluence plugin, but shows the basic elements in the POM for any type of Atlassian plugin project. So far, no additional modules have been added to the plugin project.
How the SDK generates POM values
In general, our sample POM uses standard Maven object model syntax, as described here http://maven.apache.org/pom.html. However, it's worth looking at how the SDK generates the POM for a specific project:
modelVersionelement refers to the object model version used by the SDK. You should not need to change this value.
versionelements reflect values you supplied at the prompts presented by the create plugin script:
These identify the package, classname and refer to the version of the plugin itself. These values are visible to the administrators of the host application where the plugin is deployed from within UPM.
artifactIdare concatenated to make up the add-on key. The add-on key is the unique ID that the Atlassian framework uses to identify the add-on.
- The SDK adds default values for the project
organizationvalues, which also appear in the details view for the add-on.
This view is particularly important if you're developing a plugin for distribution on the Atlassian Marketplace. However, even if you are developing a plugin for internal consumption only, it's helpful to provide a meaningful project name, description, and other details of the add-on. You may even choose to include additional assets, such as a screenshot. For more information on customizing the add-on view in the Manage Add-ons page, see Plugin metadata files used by UPM and Marketplace.
packagingshould always be
dependenciesspecify the libraries that your plugin needs. For more about managing dependencies with the POM, see Managing Dependencies.
builddescribes detailed build settings. Note that the SDK adds the following plugins to Maven:
propertiesspecifies the target host application and version and the version of the SDK used to generate the project. These determine the environment that the SDK starts up when you enter the atlas-run command in the project home directory. They do not affect the final artifact of the project, the JAR file that can be installed to the host application.