fix(build): flatten ${revision} into installed POMs

This commit is contained in:
matevip 2026-05-18 10:45:30 +08:00
parent b06bd66435
commit 247c607b3c

35
pom.xml
View File

@ -26,8 +26,6 @@
<!-- Java -->
<java.version>21</java.version>
<maven.compiler.release>${java.version}</maven.compiler.release>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Spring ecosystem -->
@ -71,6 +69,7 @@
<maven-compiler-plugin.version>3.14.1</maven-compiler-plugin.version>
<maven-dependency-plugin.version>3.8.1</maven-dependency-plugin.version>
<maven-surefire-plugin.version>3.5.5</maven-surefire-plugin.version>
<flatten-maven-plugin.version>1.7.0</flatten-maven-plugin.version>
</properties>
<dependencyManagement>
@ -350,7 +349,7 @@
</plugins>
</pluginManagement>
<!-- Shared compiler defaults for all Maven modules. -->
<!-- Shared build defaults inherited by every Maven module. -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -363,6 +362,36 @@
<parameters>true</parameters>
</configuration>
</plugin>
<!-- Resolve the ${revision} CI-friendly version into installed and
deployed POMs. Without this the literal ${revision} leaks into
the repository, breaking single-module builds and any consumer
of these artifacts. resolveCiFriendliesOnly leaves the rest of
the POM untouched. -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${flatten-maven-plugin.version}</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>