Maven options as map.

This commit is contained in:
Manuele Simi 2019-05-28 21:59:08 +02:00
parent dabe96d838
commit 3926924b66
1 changed files with 10 additions and 9 deletions

19
Jenkinsfile vendored
View File

@ -1,18 +1,19 @@
// set the build options according to the Type of build
def (options,maven_local_repo_path,maven_settings_file) = ['','','']
def jobOptions = ''
def mavenOptions = [jdk: 'OpenJDK 8']
if (params.Type == 'SNAPSHOT') {
echo "Will configure Maven for SNAPSHOT artifacts"
options = ''
maven_local_repo_path = ''
maven_settings_file = ''
jobOptions = ''
mavenOptions['mavenLocalRepo'] = ''
mavenOptions['mavenSettingsFilePath'] = ''
}
if (params.Type == 'RELEASE') {
echo "Will configure Maven for RELEASE artifacts"
jobOptions "Will configure Maven for RELEASE artifacts"
options = ''
maven_local_repo_path = ''
maven_settings_file = ''
mavenOptions['mavenLocalRepo'] = ''
mavenOptions['mavenSettingsFilePath'] = ''
}
pipeline {
@ -20,7 +21,7 @@ pipeline {
// environment variables available to the Pipeline
environment {
JOB_OPTIONS = "${options}"
JOB_OPTIONS = "${jobOptions}"
}
parameters {
@ -32,7 +33,7 @@ pipeline {
stages {
stage('build core components') {
steps {
withMaven(jdk: 'OpenJDK 8', mavenLocalRepo: "${maven_local_repo_path}, mavenSettingsFilePath: "${maven_settings_file}) {
withMaven(mavenOptions) {
build 'maven-parent'
build 'gcube-bom'
build 'authorization-common-library'