Skip to content

Commit

Permalink
adjust also MavenCommands passed to maven library methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jstastny-cz committed Nov 2, 2023
1 parent 97172ba commit 84c049e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
20 changes: 14 additions & 6 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ pipeline {
steps {
script {
dir(getRepoName()) {
maven.mvnVersionsUpdateParentAndChildModules(getMavenCommand(), getProjectVersion(), !isRelease())
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
maven.mvnVersionsUpdateParentAndChildModules(
getMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE),
getProjectVersion(),
!isRelease()
)
}
}
}
}
Expand Down Expand Up @@ -293,13 +299,15 @@ void runMavenDeploy(boolean skipTests = true, boolean localDeployment = false) {
}

void runMavenStage() {
MavenStagingHelper stagingHelper = getStagingHelper()
deployProperties.putAll(stagingHelper.stageLocalArtifacts(env.NEXUS_STAGING_PROFILE_ID, getLocalDeploymentFolder()))
stagingHelper.promoteStagingRepository(env.NEXUS_BUILD_PROMOTION_PROFILE_ID)
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
MavenStagingHelper stagingHelper = getStagingHelper(getMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE))
deployProperties.putAll(stagingHelper.stageLocalArtifacts(env.NEXUS_STAGING_PROFILE_ID, getLocalDeploymentFolder()))
stagingHelper.promoteStagingRepository(env.NEXUS_BUILD_PROMOTION_PROFILE_ID)
}
}

MavenStagingHelper getStagingHelper() {
return new MavenStagingHelper(this, getMavenCommand())
MavenStagingHelper getStagingHelper(MavenCommand mavenCommand) {
return new MavenStagingHelper(this, mavenCommand)
.withNexusReleaseUrl(env.NEXUS_RELEASE_URL)
.withNexusReleaseRepositoryId(env.NEXUS_RELEASE_REPOSITORY_ID)
}
Expand Down
8 changes: 7 additions & 1 deletion .ci/jenkins/Jenkinsfile.setup-branch
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ pipeline {
stage('Update project version') {
steps {
script {
maven.mvnVersionsUpdateParentAndChildModules(getMavenCommand(getRepoName()), getKogitoVersion(), true)
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
maven.mvnVersionsUpdateParentAndChildModules(
getMavenCommand(getRepoName()).withSettingsXmlFile(MAVEN_SETTINGS_FILE),
getKogitoVersion(),
true
)
}
}
}
}
Expand Down

0 comments on commit 84c049e

Please sign in to comment.