In this hands-on lab, we will be looking at working with artifacts and fingerprints. We will install the copy artifact plugin, and we will pass artifacts between jobs. This will allow us to _chain_ builds to segment the build process. This is needed to prevent overrun where a team that feeds a section of the pipeline has access to another area that is not under their direct scope.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create the `webdev` folder and the `index` project
- Once logged in to the Jenkins Dashboard, configure Maven on the server and name it
M3
. - Under new item, create a folder named
webdev
. - Inside the
webdev
folder, make a freestyle project namedindex
. - Configure the project using the Git repo in the instructions, and ensure the M3 Maven Server is configured.
- Run the shell command
bin/makeindex
, and then archive theindex.jsp
file.
- Once logged in to the Jenkins Dashboard, configure Maven on the server and name it
- Install the copy artifact plugin
- Navigate to the main page Jenkins > Manage Jenkins > Manage Plugins.
- Click the Available tab.
- Search for copy artifact in the upper-right Filter field.
- Click the radio button for Copy Artifact.
- Click Download now and install after restart.
- Click Restart Jenkins when installation is complete and no jobs are running.
- Wait for Jenkins to restart.
- Create and build the `tomcat` project
- Inside the
backend
>tomcat
folder, create a freestyle project namedtomcat
. - The first build step should be copying the artifact from the
webdev/index
job tosrc/main/webapp
in thetomcat
job. - Using the M3 Maven Server, run
clean package
. - Create a post-build step that published JUnit tests from the
target/surefire-reports/*.xml
directory. - Run the build and confirm that the tests are published.
- Inside the