This is an automated email from the ASF dual-hosted git repository.

thiagoelg pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new 35492f36173 NO-ISSUE: Fix setPromProperty when maven-base pom.xml is 
invalid (#3412)
35492f36173 is described below

commit 35492f3617327f386735603a116a878d48059719
Author: Thiago Lugli <[email protected]>
AuthorDate: Wed Jan 28 11:28:30 2026 -0300

    NO-ISSUE: Fix setPromProperty when maven-base pom.xml is invalid (#3412)
---
 packages/maven-base/README.md | 2 +-
 packages/maven-base/index.js  | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/packages/maven-base/README.md b/packages/maven-base/README.md
index 1ab5a2ce9a0..35ab342636a 100644
--- a/packages/maven-base/README.md
+++ b/packages/maven-base/README.md
@@ -23,7 +23,7 @@ Foundational files for Maven-based packages.
 - `settings.xml`: Moslty repositories configuration.
 - `index.js`: Essential scripts for configuring properties such as 
`-Drevision` and `-Dmaven.repo.local.tail`.
 
-For more information, refer to the [KIE Tools :: 
Manual](../../repo/docs/MANUAL.md#specifics--maven)
+For more information, refer to the [KIE Tools :: 
Manual](../../repo/MANUAL.md#specifics--maven)
 
 ---
 
diff --git a/packages/maven-base/index.js b/packages/maven-base/index.js
index 9c8ad5358ea..6809e99ce6e 100755
--- a/packages/maven-base/index.js
+++ b/packages/maven-base/index.js
@@ -142,10 +142,15 @@ module.exports = {
     console.info(`[maven-base] Setting property '${key}' with value 
'${value}'...`);
     console.time(`[maven-base] Setting property '${key}' with value 
'${value}'...`);
 
-    const cmd = `mvn versions:set-property -Dproperty=${key} 
-DnewVersion=${value} -DgenerateBackupPoms=false ${BOOTSTRAP_CLI_ARGS}`;
+    // Using "sed" instead of "mvn versions:set-property" because Maven fails 
if the pom.xml is invalid before setting the property.
+    // This may happen if you're bootstraping the repo with a new 
"KOGITO_RUNTIME_version" value before building "packages/drools-and-kogito" 
with the previous one, for example.
+    const cmd = `sed -i 's|<${key}>.*</${key}>|<${key}>${value}</${key}>|g' 
pom.xml`;
 
     if (process.platform === "win32") {
       cp.execSync(cmd.replaceAll(" -", " `-"), { stdio: "inherit", shell: 
"powershell.exe" });
+    } else if (process.platform === "darwin") {
+      // Account for macOS BSD sed implementation
+      cp.execSync(cmd.replace("-i", "-i ''"), { stdio: "inherit" });
     } else {
       cp.execSync(cmd, { stdio: "inherit" });
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to