Building from SCM

1 hour
  • 2 Learning Objectives

About this Hands-on Lab

In this lab we configure Maven to perform a build. This includes pulling the source code for the build from SCM. At the end of the build process, we also create an artifact for the build.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Configure Maven Installer

Navigate to the public IP address and specify port 8080.

Navigate to Manage Jenkins and then Global Tool Configuration. Scroll down to Maven installations and add a new one.

The Maven installation should be named "M3".

Create a new Maven installation and set it to install automatically.

Configure the Build to Use Maven and Make the Index File

Create a new Freestlye Project called "mavenproject".

Update the source code management to use the Git repository provided in the lab instructions.

Add and configure a build step for top-level Maven components.

Configure M3 as the Maven server and set the Goals to "clean package".

Configure a build step to run the following go command:

bin/makeindex

Add a post-build step to archive the artifacts.

Fingerprint all archived artifacts and set the file to index.jsp.

Run the build and verify that the index.jsp is in the root of the directory.

Additional Resources

Your company is ready to start utilizing the Jenkins server that you installed. The first project that they would like to convert to run on Jenkins is a Maven project from your company's M3 Maven server. This is to replace that server, but projects built there have the instance name hardcoded.

You are to create a project named "mavenproject". This should pull the code from the git repo and build the project. This should include the call to the binary that creates the index.jsp file:

go build bin/makeindex 

The index.jsp file needs to be tracked for version control purposes.

The Jenkins login information is as follows:

  • User: student
  • Password: OmgPassword!

The URI of the git repository for this lesson is https://github.com/linuxacademy/content-cje-prebuild.git

Note: Please allow 3 minutes before starting this lab to make sure it is fully provisioned before starting.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Get Started
Who’s going to be learning?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


$2,495.00

Checkout
Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!