Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-480: Bring back POM revision property #481

Merged
merged 2 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 23 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.flattened-pom.xml is still missing in .gitignore.

We don't need that because the file is stored into a target directory which is already under ignore.
I don't see any argument why this file has to be in the root project dir when we are interested in it only at runtime on install or deploy, so that is indeed a volatile entity for project build lifecycle and that is totally enough to have it in the target alongside with the rest of artifacts to deliver.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do that, you don't need clean then. Again, if you decide to do things differently, please do that consistently.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. That’s what I did in the last commit. Please, double check the latest change set in the PR

<flattenMode>oss</flattenMode>
artembilan marked this conversation as resolved.
Show resolved Hide resolved
<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>

Expand Down
Loading