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:
parent
501fea9df2
commit
5da70a384c
1 changed files with 3 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
final String mvn = "mvn --batch-mode --update-snapshots --errors"
|
final String mvn = "mvn --batch-mode --update-snapshots --errors"
|
||||||
|
final dependenciesSupportJDK=9
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
@ -66,6 +67,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build Java 9') {
|
stage('Build Java 9') {
|
||||||
|
when { expression { dependenciesSupportJDK >= 9 } }
|
||||||
steps {
|
steps {
|
||||||
withMaven(maven: 'maven', jdk: 'JDK 9') {
|
withMaven(maven: 'maven', jdk: 'JDK 9') {
|
||||||
sh "${mvn} clean verify -Djava.version=9"
|
sh "${mvn} clean verify -Djava.version=9"
|
||||||
|
@ -73,6 +75,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build Java 10') {
|
stage('Build Java 10') {
|
||||||
|
when { expression { dependenciesSupportJDK >= 10 } }
|
||||||
steps {
|
steps {
|
||||||
withMaven(maven: 'maven', jdk: 'JDK 10') {
|
withMaven(maven: 'maven', jdk: 'JDK 10') {
|
||||||
sh "${mvn} clean verify -Djava.version=10"
|
sh "${mvn} clean verify -Djava.version=10"
|
||||||
|
|
Loading…
Reference in a new issue