From 9131e6a02a29d83d5dc2a269d1a1d2fd42c31554 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Wed, 1 Jan 2025 18:35:39 -0500 Subject: [PATCH] GH-480: Bring back POM `revision` property (#481) Fixes: https://github.com/spring-projects/spring-retry/issues/480 * Add `flatten-maven-plugin` to resolve properties and remove unnecessary build info from the final POM of the artifact to install/deploy * Revert `version` extraction from POM via `sed` command in the build action * Remove `flatten.clean` from the Maven Flatter Plugin, since `.flattened-pom.xml` generated file is landed in the `/target` dir * Add `pomElements/profiles` for removal in the result `.flattened-pom.xml` --- .github/actions/build/action.yml | 2 +- pom.xml | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index be1f2b7..5152764 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -39,6 +39,6 @@ runs: id: read-version shell: bash run: | - version=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout) + version=$(sed -n 's/^.*\(.*\)<\/revision>.*$/\1/p' pom.xml) echo "Version is $version" echo "version=$version" >> $GITHUB_OUTPUT diff --git a/pom.xml b/pom.xml index fe8231c..49ef023 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.springframework.retry spring-retry - 2.0.12-SNAPSHOT + ${revision} Spring Retry + 2.0.12-SNAPSHOT false 17 UTF-8 @@ -302,6 +303,27 @@ + + org.codehaus.mojo + flatten-maven-plugin + 1.6.0 + + ${project.build.directory} + oss + + remove + + + + + flatten + process-resources + + flatten + + + +