jenkins: fix syntax #4

This commit is contained in:
Paul Campbell 2018-03-03 11:55:44 +00:00
parent d6564cef08
commit 08e051799d

View file

@ -12,13 +12,13 @@ pipeline {
stage('no SNAPSHOT in master') { stage('no SNAPSHOT in master') {
// checks that the pom version is not a snapshot when the current branch is master // checks that the pom version is not a snapshot when the current branch is master
// TODO: also check for SNAPSHOT when is a pull request with master as the target branch // TODO: also check for SNAPSHOT when is a pull request with master as the target branch
final Model pom = readMavenPom file: 'pom.xml'
when { when {
expression { expression {
(env.GIT_BRANCH == 'master') && (env.GIT_BRANCH == 'master') &&
(pom.version).contains("SNAPSHOT") } (readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT") }
} }
steps { steps {
def pom = readMavenPom(file: 'pom.xml')
error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}") error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}")
} }
} }