Skip to content

Commit

Permalink
Use different JDK for klass-api vs klass-forvaltning
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaar, Bjørn-Andre committed Jan 24, 2024
1 parent a61b0ab commit db38878
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ pipeline {
pollSCM('H/5 * * * *')
}

tools {
jdk 'OpenJDK Java 17'
maven 'Maven 3.5.2'
git 'Default'
}

parameters {
booleanParam(name: "RELEASE",
description: "Build a release from current commit.",
defaultValue: false)
choice(name: 'Artifact',
choices: ['klass-api', 'klass-forvaltning'],
description: 'Name of artifact to build and deploy.'
)
}

parameters {
Expand All @@ -28,11 +23,21 @@ pipeline {
defaultValue: false)
}

tools {
if (${params.Artifact} == 'klass-api') {
jdk 'OpenJDK Java 17'
} else {
jdk 'Oracle Java 8'
}
maven 'Maven 3.5.2'
git 'Default'
}

stages {

stage("Build & deploy SNAPSHOT to Nexus") {
steps {
sh "mvn -B clean deploy -Pdocumentation -pl :klass-api -am"
sh "mvn -B clean deploy -Pdocumentation -pl :${params.Artifact} -am"
}
}

Expand All @@ -45,7 +50,7 @@ pipeline {
sshagent(['605c16cc-7c0c-4d39-8c8a-6d190e2f98b1']) {
sh('git push --follow-tags')
}
sh "mvn -B release:perform -pl :klass-api -am"
sh "mvn -B release:perform -pl :${params.Artifact} -am"
}
}

Expand Down

0 comments on commit db38878

Please sign in to comment.