From 586624856869360da528f2dd933843f6797e78da Mon Sep 17 00:00:00 2001 From: Kezhi Xiong Date: Mon, 6 Jul 2020 21:27:04 +0800 Subject: [PATCH 1/2] Change grammar for maven --- Jenkinsfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3a5d011b..ed61d1e1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,12 +1,10 @@ node { - def mvnHome = tool 'mvn-default' - stage ('Checkout') { checkout scm } stage ('Build and Static Analysis') { - withMaven(maven: 'mvn-default', mavenOpts: '-Xmx768m -Xms512m') { + withMaven { sh 'mvn -ntp -V -e clean verify -Dmaven.test.failure.ignore -Dgpg.skip' } @@ -23,14 +21,14 @@ node { } stage ('Line and Branch Coverage') { - withMaven(maven: 'mvn-default', mavenOpts: '-Xmx768m -Xms512m') { + withMaven { sh "mvn -ntp -V -U -e jacoco:prepare-agent test jacoco:report -Dmaven.test.failure.ignore" } publishCoverage adapters: [jacocoAdapter('**/*/jacoco.xml')], sourceFileResolver: sourceFiles('STORE_ALL_BUILD') } stage ('Mutation Coverage') { - withMaven(maven: 'mvn-default', mavenOpts: '-Xmx768m -Xms512m') { + withMaven { sh "mvn -ntp org.pitest:pitest-maven:mutationCoverage" } step([$class: 'PitPublisher', mutationStatsFile: 'target/pit-reports/**/mutations.xml']) From 38d6bf11d9230a149eaaa486f57d5df2d5528fc3 Mon Sep 17 00:00:00 2001 From: Kezhi Xiong Date: Mon, 6 Jul 2020 21:55:28 +0800 Subject: [PATCH 2/2] Use only buildPlugin() in Jenkinsfile --- Jenkinsfile | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ed61d1e1..a229fa51 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,36 +1 @@ -node { - stage ('Checkout') { - checkout scm - } - - stage ('Build and Static Analysis') { - withMaven { - sh 'mvn -ntp -V -e clean verify -Dmaven.test.failure.ignore -Dgpg.skip' - } - - recordIssues tools: [java(), javaDoc()], aggregatingResults: 'true', id: 'java', name: 'Java' - - junit testResults: '**/target/*-reports/TEST-*.xml' - - recordIssues tools: [checkStyle(pattern: 'target/checkstyle-result.xml'), - spotBugs(pattern: 'target/spotbugsXml.xml'), - pmdParser(pattern: 'target/pmd.xml'), - cpd(pattern: 'target/cpd.xml'), - taskScanner(highTags:'FIXME', normalTags:'TODO', includePattern: '**/*.java', excludePattern: 'target/**/*')], - qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]] - } - - stage ('Line and Branch Coverage') { - withMaven { - sh "mvn -ntp -V -U -e jacoco:prepare-agent test jacoco:report -Dmaven.test.failure.ignore" - } - publishCoverage adapters: [jacocoAdapter('**/*/jacoco.xml')], sourceFileResolver: sourceFiles('STORE_ALL_BUILD') - } - - stage ('Mutation Coverage') { - withMaven { - sh "mvn -ntp org.pitest:pitest-maven:mutationCoverage" - } - step([$class: 'PitPublisher', mutationStatsFile: 'target/pit-reports/**/mutations.xml']) - } -} +buildPlugin()