From 3926924b667d1489a9d5ae62df236d17f9776135 Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Tue, 28 May 2019 21:59:08 +0200 Subject: [PATCH] Maven options as map. --- Jenkinsfile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d4f2930..c69e0f3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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'