December 2017
Beginner to intermediate
362 pages
8h 35m
English
The example project that we are using in the current chapter is a Maven project. Therefore, the pipeline code for the build is a simple shell script that runs the mvn clean command:
sh 'mvn clean verify -DskipITs=true';junit '**/target/surefire-reports/TEST-*.xml'archive 'target/*.jar'
Where -DskipITs=true is the option to skip the integration test and perform only the build and unit test.
The junit '**/target/surefire-reports/TEST-*.xml' command enables Jenkins to publish JUnit unit test reports on the Jenkins pipeline page. **/target/surefire-reports/TEST-*.xml is the directory location where the unit test reports are generated.
Read now
Unlock full access