jenkins: add check for dependency support

Only update dependenciesSupportJDK when all dependencies are compatible,
particularly lombok. Only run against a JDK when dependencies support it.

This prevents failing builds when it isn't our code that is failing.
This commit is contained in:
Paul Campbell 2018-05-14 19:49:56 +01:00
parent 501fea9df2
commit 5da70a384c

View file

@ -1,4 +1,5 @@
final String mvn = "mvn --batch-mode --update-snapshots --errors"
final dependenciesSupportJDK=9
pipeline {
agent any
@ -66,6 +67,7 @@ pipeline {
}
}
stage('Build Java 9') {
when { expression { dependenciesSupportJDK >= 9 } }
steps {
withMaven(maven: 'maven', jdk: 'JDK 9') {
sh "${mvn} clean verify -Djava.version=9"
@ -73,6 +75,7 @@ pipeline {
}
}
stage('Build Java 10') {
when { expression { dependenciesSupportJDK >= 10 } }
steps {
withMaven(maven: 'maven', jdk: 'JDK 10') {
sh "${mvn} clean verify -Djava.version=10"