Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt

Repository Connector adds features around resolving artifacts from a Maven repository like Nexus or Artifactory.

When installing this plugin, you'll get an additional build parameter 'Maven Repository Artifact' and a build step called 'Artifact Resolver'. It allows you to define as many build parameters or build steps as you wish.

Usage

There are 2 phases involved:

  • version selection
  • artifact download

You can

...

Usage

Build parameters can be used for version selection and the build step to download the artifact without the need to install Maven.

You can either use the version selection feature alone and let a Maven POM do the artifact download, or let Jenkins also do the download before a script is invoked.

The way you use the plugin is completely up to you, the way of just selecting the version makes sense when you have Maven installed anyway and you want to have all aspects of the artifact processing under version control.

Version Selection

String Parameter

You can use a simple String build parameter (e.g. 'VERSION') to enter a version as free text:

  • 1.0.0 - a regular version
  • RELEASE - the latest release version
  • LATEST - the latest version, which is usually a SNAPSHOT version
  • Wiki Markup
    *\[0-SNAPSHOT,)* \- a version range

This String parameter can be used in the later stages of the job by the property ${VERSION}. It can even be used in the version field of the Artifact Resolver build step.

Maven Repository Artifact Parameter

The version selection feature is provided by the build parameter 'Maven Respoitory Respository Artifact':

When you click on "Build with Parameters" you will see a drop-down box with all the versions that have been found in the Maven repository.

...

  • <groupId>.<artifactId>=<version> (e.g. "commons-collections.commons-collections=1.0.0")
  • <global-repo-name>=<version> (e.g. "central=1.0.0")

Alternatively you can use a simple String build parameter (e.g. 'VERSION') in order to allow more complex Maven version definitions:

  • RELEASE - the latest release version
  • LATEST - the latest version, which is usually a SNAPSHOT version
  • Wiki Markup
    *\[0-SNAPSHOT,)* \- a version range

one is also able to define a job as parametrized and use the parameter within each field in the config - e.g. define a string parameter called 'VERSION' and use it as ${VERSION}

within the Version field in the config.

Respository Connector uses sonatypes aether api to resolve artifacts from a repository.

...