Nexus triggers

The Release Nexus trigger allows Release to interact with Sonatype Nexus repositories. It uses the Nexus Server REST API to communicate and fetch information from Nexus repositories.

A Nexus trigger periodically polls a Nexus server for new versions of a specific artifact and triggers a release if a new version is published to the repository being watched.

Compatibility

The Release Nexus trigger is compatible with Nexus 2. It does not support Nexus 3.0.0.

Set up a Nexus server

To set up a Nexus server:

  1. In Release, go to Settings > Shared configuration. 1. Next to Nexus: Server, click +.
  2. In the Title box, type the name of the Nexus server.
  3. In the URL box, type the server address.
  4. In the Username and Password boxes, type the server log-in user ID and password.
  5. Click Save to save the server.

    Nexus Server

Add a Nexus trigger to a template

To create a Nexus trigger:

  1. Add a trigger to the template, as described in Create a release trigger.
  2. In the Group Id box, type the group ID of the artifact.
  3. In the Artifact Id box, type the artifact ID of the artifact.
  4. In the Version box, type the version of the artifact.

    Here, you can use LATEST (default), RELEASE, and snapshot versions (such as 1.0-SNAPSHOT). Specify LATEST to trigger on both release and snapshot versions of a particular artifact. With RELEASE, only release versions will be tracked. Triggering on redeployments of release versions (such as 1.0.0) is not supported.

  5. In the Packaging box, optionally type the packaging type of the artifact (such as jar or war).
  6. In the Classifier box, optionally type the classifier of the artifact.
  7. In the Extension box, optionally type the artifact’s extension.
  8. If you want to suppress errors when an artifact is not found for the given GAV coordinates, select Trigger On Initial Publish. Select this option when the artifact was never published to Nexus and you want to trigger a release on the initial publish.
  9. In the Username and Password boxes, type the log-in user ID and password to use to connect to the server. If set, these will override the credentials defined in the Nexus server configuration.
  10. Finish saving the trigger, as described in Create a release trigger.

Note: The trigger requires a POM file to exist in the artifact directory. If you are using the Nexus Artifact Uploader plugin for Jenkins, note that it does not upload the POM file.

Output properties

The output properties of the Nexus trigger are:

  • Artifact Version: Latest artifact version retrieved from the Nexus repository
  • Artifact Base Version: Latest artifact base version retrieved from the Nexus repository. For releases, this is the same as the artifactVersion. For snapshots (such as 1.0-SNAPSHOT), it excludes the additional qualifiers
  • Artifact Snapshot Build Number: Latest artifact snapshot build number retrieved from the Nexus repository
  • Artifact Repository Path: Artifact path relative to the selected Nexus repository

Manage triggers

The Triggers management page displays an actionable list of all triggers that you have permissions to view and manage, and provides the entry point for creating new triggers. For details, see Triggers.