pipeline { agent any triggers { pollSCM('H/1 * * * *') } stages { stage('Checkout') { steps { checkout scm } } stage ('Compile & Test') { agent { docker { image 'eclipse-temurin:21-jdk' args '-v "$PWD":/app' reuseNode true } } steps { sh './gradlew clean check -x pitest -x dependencyCheckAnalyze' } } stage('Archive Test Results') { steps { // archive test results junit 'build/test-results/test/*.xml' // archive the JaCoCo coverage report in XML and HTML format publishHTML(target: [ reportDir: 'build/reports/jacoco/test/html', reportFiles: 'index.html', reportName: 'JaCoCo Code Coverage Report' ]) jacoco(execPattern: '**/jacoco.exec', classPattern: 'build/classes/java/main', sourcePattern: 'src/main/java', exclusionPattern: '') } } } post { always { cleanWs() } } }