Improved Jenkinsfile: simplified maven command.
node {
stage ('Checkout') {
- git branch:'master', url: 'https://github.com/jenkinsci/analysis-model.git'
+ checkout scm
}
stage ('Build') {
withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx768m -Xms512m') {
- sh 'mvn clean install --batch-mode -V -U -e clean verify -DskipTests'
+ sh 'mvn -V -U -e clean verify -DskipTests'
}
recordIssues tools: [java(), javaDoc()], aggregatingResults: 'true', id: 'java', name: 'Java'
@@ -13,8 +13,8 @@ node {
}
stage ('Analysis') {
- withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx2048m -Xms512m -XX:PermSize=256m') {
- sh "mvn --batch-mode -V -U -e verify"
+ withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx768m -Xms512m') {
+ sh "mvn -V -U -e verify"
}
junit testResults: '**/target/*-reports/TEST-*.xml'
@@ -26,8 +26,8 @@ node {
}
stage ('Coverage') {
- withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx2048m -Xms512m -XX:PermSize=256m') {
- sh "mvn --batch-mode -V -U -e jacoco:prepare-agent test jacoco:report -Djenkins.test.timeout=240"
+ withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx768m -Xms512m') {
+ sh "mvn -V -U -e jacoco:prepare-agent test jacoco:report -Djenkins.test.timeout=240"
}
publishCoverage adapters: [jacocoAdapter('target/site/jacoco/jacoco.xml')]
}
