From 459114c97ab91124dbcab3342904cd8ce2cd7a62 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Wed, 18 Dec 2024 14:47:53 -0500 Subject: [PATCH 1/2] GH-480: Bring back POM `revision` property 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 --- pom.xml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fe8231c1..36d62a1f 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,31 @@ + + org.codehaus.mojo + flatten-maven-plugin + 1.6.0 + + ${project.build.directory} + oss + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + From af9647fd76e5ae7d771f4ea69be9d7515abe5c22 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Mon, 23 Dec 2024 13:17:11 -0500 Subject: [PATCH 2/2] * `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 | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index be1f2b72..5152764c 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 36d62a1f..49ef0239 100644 --- a/pom.xml +++ b/pom.xml @@ -310,6 +310,9 @@ ${project.build.directory} oss + + remove + @@ -319,13 +322,6 @@ flatten - - flatten.clean - clean - - clean - -