Slide 1

Slide 1 text

Managing build artifacts with Nexus ThoughtWorks

Slide 2

Slide 2 text

Outline •The Repository Manager •Our use-case(s) •Component lifecycle •Nexus Setup

Slide 3

Slide 3 text

A repository manager Stores and organizes binary software components (a.k.a jars) for use during your development lifecycle

Slide 4

Slide 4 text

benefits •A destination for internally developed software artifacts •Share software components across other internally developed projects •Can proxy between the organization and public repositories •Faster and reliable builds •Greater visibility into your component library, and its usage

Slide 5

Slide 5 text

our use case... ✓A destination for internally developed software artifacts ✓Share software components across other internally developed projects •Can proxy between the organization and public repositories ✓Faster and reliable builds •Greater visibility into your component library, and its usage

Slide 6

Slide 6 text

our use case... •Host snapshot releases for components being developed •Host fixed versions of artifacts for environments that need specific releases •Segregate artifacts into different repositories (e.g. frameworks, apps, etc) •A local Maven repository

Slide 7

Slide 7 text

Component lifecycle •Distributing Maven artifacts •Consuming components •Releasing the Maven artifacts

Slide 8

Slide 8 text

Build lifecycle Clean Compile Test Package Verify Deploy

Slide 9

Slide 9 text

A sample pom.xml com.foo.app shared-lib 1.0-SNAPSHOT jar .... nexus-snapshots http:/ /10.15.1.150:3001/nexus/content/repositories/snapshots/ mvn deploy (and that’s it)

Slide 10

Slide 10 text

Consuming artifacts com.foo.app consumer-api war 1.0-SNAPSHOT .... nexus Nexus true always fail http:/ /10.15.1.150:3001/nexus/content/repositories/snapshots/ default ... 1. declare the maven repository

Slide 11

Slide 11 text

Consuming artifacts .... com.foo.app shared-lib 1.0-SNAPSHOT ... 3. mvn compile (and that’s it) 2. declare the jar- dependency 2. declare the jar- dependency

Slide 12

Slide 12 text

Releasing the artifacts 1. Declare git URLs com.foo.app shared-lib 1.0-SNAPSHOT jar ... scm:git:[email protected]:/shared-lib.git scm:git:[email protected]:/shared-lib.git scm:git:[email protected]:/shared-lib.git .... nexus-releases http:/ /10.15.1.150:3001/nexus/content/repositories/releases/ 2. Declare release repository

Slide 13

Slide 13 text

Releasing the artifacts .... org.apache.maven.plugins maven-release-plugin 2.4.1 ... 4. mvn release:prepare mvn release:perform (and that’s it) 3. Use the release plugin

Slide 14

Slide 14 text

Nexus Setup •A war that can be deployed to Tomcat •Register an ‘ admin’ user •And you’re good to go.

Slide 15

Slide 15 text

Nexus Setup

Slide 16

Slide 16 text

Questions? [email protected]