The EC-Nexus plugin is the CloudBees CD/RO integration to the Sonatype Nexus Repository Manager. For more information about Nexus Repository Manager please refer to Sonatype Nexus documentation.
-
Nexus Repository Manager 2 - NXRM 2 Documentation
-
Nexus Repository Manager 3 - NXRM 3 Documentation
Nexus 3 provides a well documented REST interface, as such the plugin integration is able to leverage all capabilities of Nexus 3.
This plugin supports all the following repository formats: * Maven * NPM * NuGet * RubyGems * Raw
Plugin version 2.0.0.2022021822
Revised on February 18, 2022
Updated Perl version required
This plugin is using an updated version of Perl, cb-perl shell (instead of old ec-perl). This means that it needs CloudBees CD agent version 10.3+ in order to work.
Plugin configurations
Plugin configurations are sets of parameters that apply across some or all of the plugin procedures. They reduce repetition of common values, create predefined parameter sets for end users, and securely store credentials where needed. Each configuration is given a unique name that is entered in designated parameters on procedures that use them.
Creating plugin configurations
To create plugin configurations in CloudBees CD/RO, do these steps:
-
Go to
to open the Plugin Manager. -
Find the EC-Nexus-2.0.0.2022021822 row.
-
Click Configure to open the Configurations page.
-
Click Create Configuration as per the description of parameters below.
Configuration procedure parameters
Parameter | Description |
---|---|
Configuration | Unique name for the plugin configuration. |
Description | Description for the plugin configuration. |
Nexus repository manager endpoint | The URL to use to connect to a Nexus server. For example: http://10.10.10.10:8081/nexus or http://yourNexusServer. |
Ignore SSL errors | Turn SSL verification off for instances with self-signed certificates. |
Nexus credentials | User name and password used to connect to Nexus Repository Manager. |
Debug level | Verbosity level of output. |
Test connection? | If checked, the credentials will be checked before the configuration is saved. |
HTTP proxy | A proxy that should be used for connections. |
Proxy authorization | Username and password for proxy. |
Plugin procedures
Retrieve Artifact from Nexus
Retrieves the specified artifact from repository and saves the attributes.
Retrieve Artifact from Nexus parameters
Parameter | Description |
---|---|
Configuration | Previously defined plugin configuration. |
Repository | Id of the Nexus repository from which to retrieve artifact. |
Repository format | Format (for example Maven2, npm, NuGet etc.,) used to store, retrieve and index Components (for example packages, binaries, libraries, containers etc.,) |
Group | This parameter applies only when you use either Maven or Raw Repository formats. If using Maven or Raw Repository formats, enter the Group Name, for example 'org.apache.maven'. |
Artifact | This should be one of the following based on the Repository format: * Artifact name for the Maven format; * Filename for a Raw artifact; * Component Name for other format types; For example, maven-core or commons-lang etc., |
Latest Maven artifact version? | Retrieve latest version? Nexus supports this functionality only for the Maven repository format. |
Version | Version of the artifact or the component to be retrieved from Nexus |
Classifier | A sequence of literals that identifies the artifact’s classifier. |
Extension | File extension of artifact or component (e.g., jar, pom, tar.gz) |
Destination directory | Destination directory for artifact retrieval. If empty artifact will be retrieved to the current job workspace. |
Overwrite? | Overwrite if already exists in destination? |
Result property sheet | Property under which retrieved-artifact results are saved. By default it would use the namespace which starts with '/myJob/retrievedArtifactVersions/$[resourceName]' |
Get Latest Artifact Version
Procedure will get and save the latest artifact’s version to the specified property
Get Latest Artifact Version parameters
Parameter | Description |
---|---|
Configuration | Previously defined plugin configuration. |
Repository | Name of the Nexus repository from which to retrieve artifact. |
Repository format | This is defaulted to Maven. For this procedure this is currently the only supported repository format. |
Group | Group Name of the Maven repository, for example 'org.apache.maven'. |
Artifact | Artifact name in Maven format. Example: 'maven-core'. |
Classifier | A sequence of literals that identifies the artifact’s classifier. |
Extension | File extension of artifact or component (e.g., jar, pom, tar.gz) |
Result property sheet | Name of the Property under which latest version should be saved. |
Component Definition
EC-Nexus may be used to define a component in CloudBees CD. To create a component, choose EC-Nexus in the drop-down list for "Content Location" in component definition.
Samples
Maven
Maven artifact in Nexus 3:

Component Definition:

Finished procedure:

Procedure logs:
Got parameter "artifactId" with value "commons-lang3" Got parameter "classifier" with value "" Got parameter "config" with value "nexus3" Got parameter "destination" with value "/tmp/" Got parameter "extension" with value "" Got parameter "groupId" with value "org.apache.commons" Got parameter "latestVersion" with value "1" Got parameter "overwrite" with value "1" Got parameter "repoType" with value "maven" Got parameter "repository" with value "maven-central" Got parameter "resultPropertySheet" with value "" Got parameter "version" with value "" Result Property Sheet path is : /myJob/retrievedArtifactVersions/local Checking that repository 'maven-central' is accessible Ignore errors: 0 Filename is determined from the asset download URL commons-lang3-3.9.jar Downloading repository/maven-central//org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar to /tmp/commons-lang3-3.9.jar. Successfully downloaded the artifact. Receiving attributes for the artifact.
NPM
NPM artifact in Nexus 3:

Component Definition:

Finished procedure:

Procedure logs:
Got parameter "artifactId" with value "left-pad" Got parameter "classifier" with value "" Got parameter "config" with value "nexus3" Got parameter "destination" with value "" Got parameter "extension" with value "" Got parameter "groupId" with value "" Got parameter "latestVersion" with value "0" Got parameter "overwrite" with value "1" Got parameter "repoType" with value "npm" Got parameter "repository" with value "npm-proxy" Got parameter "resultPropertySheet" with value "" Got parameter "version" with value "1.2.0" Result Property Sheet path is : /myJob/retrievedArtifactVersions/local Checking that repository 'npm-proxy' is accessible Ignore errors: 0 Filename is determined from the asset download URL left-pad-1.2.0.tgz Downloading repository/npm-proxy//left-pad/-/left-pad-1.2.0.tgz to ./left-pad-1.2.0.tgz. Successfully downloaded the artifact. Receiving attributes for the artifact.
NuGet
NuGet artifact in Nexus 3:

Component Definition:

Finished procedure:

Procedure logs:
Got parameter "artifactId" with value "HelloWorld" Got parameter "classifier" with value "" Got parameter "config" with value "nexus3" Got parameter "destination" with value "" Got parameter "extension" with value "" Got parameter "groupId" with value "" Got parameter "latestVersion" with value "0" Got parameter "overwrite" with value "1" Got parameter "repoType" with value "nuget" Got parameter "repository" with value "nuget-private" Got parameter "resultPropertySheet" with value "" Got parameter "version" with value "1.3.0.14" Result Property Sheet path is : /myJob/retrievedArtifactVersions/local Checking that repository 'nuget-private' is accessible Ignore errors: 0 Filename is determined from the asset download URL HelloWorld-1.3.0.14.nupkg Downloading repository/nuget-private//HelloWorld/1.3.0.14 to ./HelloWorld-1.3.0.14.nupkg. Successfully downloaded the artifact. Receiving attributes for the artifact.
Raw
Raw artifact in Nexus 3:

Component Definition:

Finished procedure:

Procedure logs:
Got parameter "artifactId" with value "npm-app1-1.1.0.tgz" Got parameter "classifier" with value "" Got parameter "config" with value "nexus3" Got parameter "destination" with value "" Got parameter "extension" with value "" Got parameter "groupId" with value "HelloWorld" Got parameter "latestVersion" with value "0" Got parameter "overwrite" with value "1" Got parameter "repoType" with value "raw" Got parameter "repository" with value "raw-private" Got parameter "resultPropertySheet" with value "" Got parameter "version" with value "1.1.0" Result Property Sheet path is : /myJob/retrievedArtifactVersions/local Checking that repository 'raw-private' is accessible Ignore errors: 0 Filename is determined from the asset download URL npm-app1-1.1.0.tgz Downloading repository/raw-private//HelloWorld/npm-app1-1.1.0.tgz to ./npm-app1-1.1.0.tgz. Successfully downloaded the artifact. Receiving attributes for the artifact. Will not use Version when looking for the artifact. This is Nexus limitation (No version is stored for raw artifacts)
RubyGems
RubyGems artifact in Nexus 3:

Component Definition:

Finished procedure:

Procedure logs:
Got parameter "repository" with value "rubygems-proxy" Got parameter "extension" with value "" Got parameter "version" with value "0.1.2" Got parameter "destination" with value "" Got parameter "groupId" with value "" Got parameter "artifactId" with value "hola" Got parameter "repoType" with value "rubygems" Got parameter "overwrite" with value "0" Got parameter "resultPropertySheet" with value "" Got parameter "classifier" with value "" Got parameter "config" with value "nexus3" Got parameter "latestVersion" with value "0" Result Property Sheet path is : /myJob/retrievedArtifactVersions/local Checking that repository 'rubygems-proxy' is accessible Ignore errors: 0 Filename is determined from the asset download URL hola-0.1.2.gem Downloading repository/rubygems-proxy//gems/h/hola-0.1.2.gem to ./hola-0.1.2.gem. Successfully downloaded the artifact. Receiving attributes for the artifact.
Known issues
-
Nexus cannot return information about the remote artifact that was not cached yet. If you are retrieving artifact that already exists at the destination, retrieve will fail because the artifact is missing in the Nexus cache, unless you will check the "Overwrite" parameter.
-
Plugin relies on the status endpoints to assume the version of NXRM. Endpoint 'service/rest/v1/status' is used for NXRM 3 and 'service/local/outreach/status' for NXRM 2
Release notes
EC-Nexus 2.0.0
-
Upgraded from perl-5.8 to perl-5.32. No backward compatibility with releases prior 10.3. Starting from this release new agent is required to run this plugin’s procedures.
-
Added an "Ignore SSL errors" flag.
EC-Nexus 1.1.2
-
Plugin now supports downloading files without version in name from the 'raw' repository.
EC-Nexus 1.1.0
-
Plugin configuration has been improved to support external credentials.
-
Proxy support added.
-
New procedure EditConfiguration introduced.
-
Enhanced verbosity for the Check Connection step of CreateConfiguration and EditConfiguration procedures.
-
Added support for the 'uniqueVersion' snapshots.
-
Added support for reverse-proxied Nexus hosts.