@@ -93,9 +93,21 @@ pipeline {
93
93
steps {
94
94
script {
95
95
dir(getRepoName()) {
96
- def oldKogitoVersion = readMavenPom(file: 'pom.xml').version
96
+ def pom = readMavenPom(file: 'pom.xml');
97
+ def oldKogitoVersion = pom.version
98
+ if (oldKogitoVersion == null) {
99
+ echo "pom version is null. Using parent pom version"
100
+ oldKogitoVersion = pom.parent.version
101
+ }
97
102
echo "Got old Kogito version ${oldKogitoVersion}"
98
103
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
104
+ // special case for serverless-workflow-examples-parent
105
+ maven.mvnVersionsSet(
106
+ getMavenCommand('serverless-workflow-examples/serverless-workflow-examples-parent').withSettingsXmlFile(MAVEN_SETTINGS_FILE),
107
+ getKogitoVersion(),
108
+ true,
109
+ false
110
+ )
99
111
maven.mvnVersionsUpdateParentAndChildModules(
100
112
getMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE),
101
113
getKogitoVersion(),
@@ -119,9 +131,10 @@ pipeline {
119
131
}
120
132
121
133
if (getKogitoVersion() != oldKogitoVersion) {
122
- def status = sh(script: "grep -ir '${oldKogitoVersion}' --include='pom.xml'", returnStatus: true)
134
+ def status = sh(script: "grep -ir '> ${oldKogitoVersion}< ' --include='pom.xml'", returnStatus: true)
123
135
if (status == 0) {
124
- error "Old Kogito version ${oldKogitoVersion} is still present into the project... Please review it..."
136
+ // some orphaned projects may still have the old version. not an error
137
+ echo "Old Kogito version ${oldKogitoVersion} is still present into the project... Please review it..."
125
138
}
126
139
}
127
140
}
0 commit comments