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