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`
This commit is contained in:
2
.github/actions/build/action.yml
vendored
2
.github/actions/build/action.yml
vendored
@@ -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>\(.*\)<\/revision>.*$/\1/p' pom.xml)
|
||||
echo "Version is $version"
|
||||
echo "version=$version" >> $GITHUB_OUTPUT
|
||||
|
||||
24
pom.xml
24
pom.xml
@@ -5,7 +5,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.retry</groupId>
|
||||
<artifactId>spring-retry</artifactId>
|
||||
<version>2.0.12-SNAPSHOT</version>
|
||||
<version>${revision}</version>
|
||||
<name>Spring Retry</name>
|
||||
<description><![CDATA[
|
||||
Spring Retry provides an abstraction around retrying failed operations, with an
|
||||
@@ -26,6 +26,7 @@
|
||||
</license>
|
||||
</licenses>
|
||||
<properties>
|
||||
<revision>2.0.12-SNAPSHOT</revision>
|
||||
<disable.checks>false</disable.checks>
|
||||
<java.version>17</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@@ -302,6 +303,27 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>flatten-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
<flattenMode>oss</flattenMode>
|
||||
<pomElements>
|
||||
<profiles>remove</profiles>
|
||||
</pomElements>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>flatten</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>flatten</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user