3 def projectName = "sebhoss/maven-build-process"
4 def repositoryLocation = ".repository"
5 def timestamp = new java.text.SimpleDateFormat('yyyy.MM.dd-HHmmss').format(new Date())
6 def mavenVersion = "maven-latest"
7 def mavenSettings = "repository.metio.wtf"
8 def releaseTarget = "sonatype"
9 def skipLocalStaging = "false"
10 def githubCredentials = "build-metio-wtf-github"
13 dir("${repositoryLocation}") {
24 maven: "${mavenVersion}",
25 mavenSettingsConfig: "${mavenSettings}",
26 mavenLocalRepo: "${repositoryLocation}") {
31 -DgenerateBackupPoms=false \
32 -DnewVersion=${timestamp}
38 withSonarQubeEnv('quality.metio.wtf') {
40 maven: "${mavenVersion}",
41 mavenSettingsConfig: "${mavenSettings}",
42 mavenLocalRepo: "${repositoryLocation}") {
53 configFileProvider([configFile(fileId: "${mavenSettings}", variable: 'MAVEN_SETTINGS')]) {
55 maven: "${mavenVersion}",
56 mavenLocalRepo: "${repositoryLocation}") {
60 --settings $MAVEN_SETTINGS \
62 -Drelease=${releaseTarget} \
63 -DskipLocalStaging=${skipLocalStaging}
71 maven: "${mavenVersion}",
72 mavenSettingsConfig: "${mavenSettings}",
73 mavenLocalRepo: "${repositoryLocation}") {
85 string(credentialsId: 'git.user.name', variable: 'GIT_USER'),
86 string(credentialsId: 'git.user.email', variable: 'GIT_EMAIL'),
87 [$class: 'UsernamePasswordMultiBinding', credentialsId: "${githubCredentials}",
88 usernameVariable: 'USERNAME', passwordVariable: 'TOKEN']]) {
89 sh "git config user.name '${GIT_USER}'"
90 sh "git config user.email '${GIT_EMAIL}'"
91 sh "git push https://${TOKEN}:x-oauth-basic@github.com/${projectName}.git --tags"