Create an add-on version from Java
The Marketplace API Java client lets you create add-on versions through the
Addons API. You might want to do this as part of an automated release process. The manual equivalent would be to go to Manage listings on Marketplace, select one of your existing add-ons, select "Create version" and fill in the version creation form.
For a stand-alone demo, see
CreateAddonVersion.java in the Marketplace API Tutorials repository.
You will need:
- A Java project that uses the
- An existing add-on listing on Marketplace (can be public or private)
MarketplaceClientobject that was configured with the credentials of your Atlassian account
- If the add-on is directly installable, the installable artifact (
.obr, or workflow file) for the new add-on version
Step 1: Specify an installable artifact
If the add-on is directly installable, and the installable artifact is in a file on your local filesystem, you can use the
uploadArtifact method in the
Assets API to upload the file. It will return an
ArtifactId, which is a reference to the file data on the Marketplace server.
Alternatively, if the artifact is not on your local filesystem but can be downloaded from a publicly accessible server (such as a Maven repository), you can simply construct an
ArtifactId that tells Marketplace where to find it:
Step 2: Build a version object
ModelBuilders.addonVersion() gives you a builder object which you can use to specify the properties for your new version.
Step 3: Post the new version to Marketplace
createVersion in the
Addons API (specifying the add-on key of your existing add-on) to send the new version to the server. If successful, it returns another
AddonVersion object containing the state of the version as it now exists on the server.
Approval for new versions
Note that Atlassian may need to approve the new version of your add-on if you are creating a public version. For example, approval is required if the add-on was previously using a different payment model or hosting option. See Add-on approval guidelines for more information.