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. Later, triggers a release if a new version is published to the repository that is being watched.
The Release Nexus trigger is compatible with Nexus 2 and Nexus 3.
- In Release, from the navigation pane, under Nexus: Server, go to Configuration > Connections and click +.
- In the Title box, type the Nexus server name.
- In the URL box, type the server address.
- In the Username and Password boxes, type the server’s username and password respectively.
Click Save to save the server.
- Add a trigger to the template, as described in Create a release trigger.
- In the Group Id box, type the artifact group ID.
- In the Artifact Id box, type the artifact ID.
In the Version box, type the artifact version.
Here, you can use
RELEASE, and snapshot versions (such as
LATESTto trigger on both release and snapshot versions of a particular artifact. With
RELEASE, only release versions will be tracked. Triggering redeployments of release versions (such as 1.0.0) is not supported.
- In the Packaging box, optionally type the packaging type of the artifact (such as
- In the Classifier box, optionally type the classifier of the artifact.
- In the Extension box, optionally type the artifact’s extension.
If you want to suppress errors when an artifact is not found for the given GAV coordinates, select Trigger On Initial Publish.
Note: Select this option when the artifact was never published to Nexus and you want to trigger a release on the initial publish.
- In the Username and Password boxes, type the username and password to connect to the server. If set, these will override the credentials defined in the Nexus server configuration.
- Save 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.
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.
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.