jenkins the definitive guide

(Jeff_L) #1

This is a convenient way to deploy or to redeploy artifacts from previous Jenkins build jobs. However, in
some cases you may prefer to use an artifact stored in an enterprise repository like Nexus or Artifactory.
We will look at an example of how to do this in the next section.


12.3.1.4. Deploying a version from a Maven repository


Many organizations use an Enterprise repository manager such as Nexus and Artifactory to store and
share binary artifacts such as JAR files. This strategy is commonly used with Maven, but also with
other build tools such as Ant (with Ivy or the Maven Ant Tasks) and Gradle. Using this approach
in a CI environment, both snapshot and release dependencies are built on your Jenkins server, and
then deployed to your repository manager (see Figure 12.10, “Using a Maven Enterprise Repository”).
Whenever a developer commits source code changes to the version control system, Jenkins will pick
up the changes and build new snapshot versions of the corresponding artifacts. Jenkins then deploys
these snapshot artifacts to the local Enterprise Repository Manager, where they can be made available
to other developers on the team or on other teams within the organization. We discussed how to get
Jenkins to automatically deploy Maven artifacts to an enterprise repository in Figure 12.10, “Using a
Maven Enterprise Repository”. A similar approach can also be done using Gradle or Ivy.


CI build
server

Snapshot
deployments
Maven enterprise
repository

Automated
updates and builds

SCM server

Source
code changes

Developers


Snapshot
updates

Figure 12.10. Using a Maven Enterprise Repository


Maven conventions use a well-defined system of version numbers, distinguishing between SNAPSHOT
and RELEASE versions. SNAPSHOT versions are considered to be potentially unstable builds of the
latest code base, whereas RELEASE versions are official releases having undergone a more formal
release process. Typically, SNAPSHOT artifacts are reserved for use within a development team,
whereas RELEASE versions are considered ready for further testing.

Free download pdf