Correcting for Jenkinsfile "stage" syntax warning

The Warning Message:

   "Using the 'stage' step without a block argument is deprecated"
This commit is contained in:
Joakim Erdfelt 2016-10-20 11:29:24 -07:00
parent b8127399d7
commit bb0ac62328
1 changed files with 38 additions and 34 deletions

72
Jenkinsfile vendored
View File

@ -11,8 +11,9 @@ node('linux') {
try try
{ {
stage 'Checkout' stage('Checkout') {
checkout scm checkout scm
}
} catch (Exception e) { } catch (Exception e) {
notifyBuild("Checkout Failure") notifyBuild("Checkout Failure")
throw e throw e
@ -20,10 +21,11 @@ node('linux') {
try try
{ {
stage 'Compile' stage('Compile') {
withEnv(mvnEnv) { withEnv(mvnEnv) {
timeout(time: 15, unit: 'MINUTES') { timeout(time: 15, unit: 'MINUTES') {
sh "mvn -B clean install -Dtest=None" sh "mvn -B clean install -Dtest=None"
}
} }
} }
} catch(Exception e) { } catch(Exception e) {
@ -33,10 +35,11 @@ node('linux') {
try try
{ {
stage 'Javadoc' stage('Javadoc') {
withEnv(mvnEnv) { withEnv(mvnEnv) {
timeout(time: 15, unit: 'MINUTES') { timeout(time: 15, unit: 'MINUTES') {
sh "mvn -B javadoc:javadoc" sh "mvn -B javadoc:javadoc"
}
} }
} }
} catch(Exception e) { } catch(Exception e) {
@ -46,30 +49,31 @@ node('linux') {
try try
{ {
stage 'Test' stage('Test') {
withEnv(mvnEnv) { withEnv(mvnEnv) {
timeout(time: 60, unit: 'MINUTES') { timeout(time: 60, unit: 'MINUTES') {
// Run test phase / ignore test failures // Run test phase / ignore test failures
sh "mvn -B install -Dmaven.test.failure.ignore=true" sh "mvn -B install -Dmaven.test.failure.ignore=true"
// Report failures in the jenkins UI // Report failures in the jenkins UI
step([$class: 'JUnitResultArchiver', step([$class: 'JUnitResultArchiver',
testResults: '**/target/surefire-reports/TEST-*.xml']) testResults: '**/target/surefire-reports/TEST-*.xml'])
// Collect up the jacoco execution results // Collect up the jacoco execution results
step([$class: 'JacocoPublisher', step([$class: 'JacocoPublisher',
execPattern: '**/target/jacoco.exec', execPattern: '**/target/jacoco.exec',
classPattern: '**/target/classes', classPattern: '**/target/classes',
sourcePattern: '**/src/main/java']) sourcePattern: '**/src/main/java'])
// Report on Maven and Javadoc warnings // Report on Maven and Javadoc warnings
step([$class: 'WarningsPublisher', step([$class: 'WarningsPublisher',
consoleParsers: [ consoleParsers: [
[parserName: 'Maven'], [parserName: 'Maven'],
[parserName: 'JavaDoc'], [parserName: 'JavaDoc'],
[parserName: 'JavaC'] [parserName: 'JavaC']
]]) ]])
} }
if(isUnstable()) if(isUnstable())
{ {
notifyBuild("Unstable / Test Errors") notifyBuild("Unstable / Test Errors")
}
} }
} }
} catch(Exception e) { } catch(Exception e) {