Skip to content
Snippets Groups Projects
Commit 8c5ac546 authored by OZGCloud's avatar OZGCloud
Browse files

Merge pull request 'OZG-5907 upload branch jars to nexus' (#31) from OZG-5907 into master

parents 1afa4333 65779e1d
Branches
Tags
No related merge requests found
......@@ -61,6 +61,28 @@ pipeline {
}
}
}
stage('Set Version') {
when {
not {
anyOf {
branch 'master'
branch 'release'
}
}
}
steps {
script {
FAILED_STAGE=env.STAGE_NAME
JAR_TAG = getPomVersion('pom.xml').replace("SNAPSHOT", "${env.BRANCH_NAME}-SNAPSHOT")
}
configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
sh "mvn -s $MAVEN_SETTINGS versions:set -DnewVersion=${JAR_TAG} -DprocessAllModules=true"
}
}
}
stage('Maven Build') {
steps {
......@@ -111,6 +133,7 @@ pipeline {
}
configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
sh 'mvn --no-transfer-progress -s $MAVEN_SETTINGS -DskipTests deploy -Dmaven.wagon.http.retryHandler.count=3'
sh "mvn -s $MAVEN_SETTINGS versions:revert"
}
}
}
......@@ -195,4 +218,9 @@ Boolean matchRegexVersion(List versions, String regex) {
}
return true
}
String getPomVersion(String pomFile){
def pom = readMavenPom file: pomFile
return pom.version
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment