jenkins junit
pipeline{ agent any environment { def appdir = "*" } stages{ stage('clear dir'){ steps{ echo "clear dir" sh ''' #!/bin/bash -xe rm -rf ./* ''' } } stage('pull code and config'){ steps{ echo "checkout from git" sh "git clone *" } } stage('compile and package'){ steps{ echo "compile and package" sh ''' cd ${app_name} mvn clean package ''' } ######################################### post { always{ junit ( testResults: '**/surefire-reports/*.xml' ) } } ######################################### } } }
生成的测试报告默认在target的surefire-reports下面。