Skip to content

Commit

Permalink
[10.0.x] NO-ISSUE: Use release settings to update version and parent …
Browse files Browse the repository at this point in the history
…versions (#3120)

Use release settings to update version and parent version
  • Loading branch information
rodrigonull authored Aug 20, 2024
1 parent fe7b906 commit 9b81dd9
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ pipeline {
}
steps {
script {
if (getDroolsVersion()) {
maven.mvnSetVersionProperty(getOptaplannerMavenCommand(), 'version.org.drools', getDroolsVersion())
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
if (getDroolsVersion()) {
maven.mvnSetVersionProperty(getOptaplannerMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE), 'version.org.drools', getDroolsVersion())
}
maven.mvnVersionsSet(getOptaplannerMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE), getProjectVersion(), !isRelease())
}
maven.mvnVersionsSet(getOptaplannerMavenCommand(), getProjectVersion(), !isRelease())
mavenCleanInstallOptaPlannerParents()
updateQuickstartsVersions()
}
Expand Down Expand Up @@ -273,8 +275,11 @@ List getIntegrationTestProfiles() {
}

void updateQuickstartsVersions() {
maven.mvnSetVersionProperty(getOptaplannerQuickstartsMavenCommand(), 'version.org.optaplanner', getProjectVersion())
maven.mvnVersionsUpdateParentAndChildModules(getOptaplannerQuickstartsMavenCommand(), getProjectVersion(), !isRelease())
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
maven.mvnSetVersionProperty(getOptaplannerQuickstartsMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE), 'version.org.optaplanner', getProjectVersion())
maven.mvnVersionsUpdateParentAndChildModules(getOptaplannerQuickstartsMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE), getProjectVersion(), !isRelease())
}

gradleVersionsUpdate(quickstartsFolder, getProjectVersion())

if (isRelease()) {
Expand Down Expand Up @@ -406,16 +411,12 @@ MavenCommand getOptaplannerQuickstartsMavenCommand() {
* Builds the parent modules and the BOM so that project depending on these artifacts can resolve.
*/
void mavenCleanInstallOptaPlannerParents() {
withCredentials([usernamePassword(credentialsId: env.MAVEN_REPO_CREDS_ID, usernameVariable: 'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
getOptaplannerMavenCommand()
.skipTests(true)
.withOptions(['-U', '-pl org.optaplanner:optaplanner-build-parent,org.optaplanner:optaplanner-bom', '-am'])
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.withProperty('apache.repository.username', "${REPOSITORY_USER}")
.withProperty('apache.repository.password', "${REPOSITORY_TOKEN}")
.run('clean install')
}
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
getOptaplannerMavenCommand()
.skipTests(true)
.withOptions(['-U', '-pl org.optaplanner:optaplanner-build-parent,org.optaplanner:optaplanner-bom', '-am'])
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.run('clean install')
}
}

Expand Down

0 comments on commit 9b81dd9

Please sign in to comment.