From 7d8a907803734fcf6ab5637d0efa7cad5baa2fee Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 30 Aug 2018 22:32:11 +0100 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile.groovy | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index bf12370..f9bfea5 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -1,6 +1,6 @@ final String publicRepo = 'https://github.com/kemitix/' final String mvn = "mvn --batch-mode --update-snapshots --errors" -final dependenciesSupportJDK = 9 +final dependenciesSupportJDK = 10 pipeline { agent any @@ -9,21 +9,27 @@ pipeline { steps { withMaven(maven: 'maven', jdk: 'JDK 1.8') { sh "${mvn} clean compile checkstyle:checkstyle pmd:pmd test" - // Code Coverage to Codacy - sh "${mvn} jacoco:report com.gavinmogan:codacy-maven-plugin:coverage " + - "-DcoverageReportFile=target/site/jacoco/jacoco.xml " + - "-DprojectToken=`$JENKINS_HOME/codacy/token` " + - "-DapiToken=`$JENKINS_HOME/codacy/apitoken` " + - "-Dcommit=`git rev-parse HEAD`" - // Code Coverage to Jenkins - jacoco exclusionPattern: '**/*{Test|IT|Main|Application|Immutable}.class' // PMD to Jenkins pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: '' + } + } + } + stage('Report Coverage') { + steps { + withMaven(maven: 'maven', jdk: 'JDK 1.8') { + // Code Coverage to Jenkins + jacoco exclusionPattern: '**/*{Test|IT|Main|Application|Immutable}.class' + } + } + } + stage('Report Checkstyle') { + steps { + withMaven(maven: 'maven', jdk: 'JDK 1.8') { // Checkstyle to Jenkins - step([$class : 'hudson.plugins.checkstyle.CheckStylePublisher', - pattern : '**/target/checkstyle-result.xml', - healthy : '20', - unHealthy: '100']) + step([$class: 'hudson.plugins.checkstyle.CheckStylePublisher', + pattern: '**/target/checkstyle-result.xml', + healthy:'20', + unHealthy:'100']) } } }