还原后端构建提交号注入

This commit is contained in:
andy
2026-07-21 15:01:16 +07:00
parent 3527659dd0
commit 3438d4daec
6 changed files with 7 additions and 96 deletions

View File

@@ -26,7 +26,6 @@
<angus-mail.version>2.0.3</angus-mail.version>
<aliyun-oss.version>3.18.3</aliyun-oss.version>
<apache-poi.version>5.4.1</apache-poi.version>
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
<th.hotel.build.commit>UNKNOWN</th.hotel.build.commit>
</properties>
@@ -126,51 +125,6 @@
<parameters>${maven.compiler.parameters}</parameters>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<executions>
<execution>
<id>verify-build-commit-before-package</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="verify-build-commit-before-package">
<condition property="th.hotel.build.commit.unknown">
<equals arg1="${th.hotel.build.commit}" arg2="UNKNOWN"/>
</condition>
<fail if="th.hotel.build.commit.unknown"
message="TH_HOTEL_BUILD_COMMIT is required before packaging. Commit changes first, then use scripts/package-server-with-build-info.sh or set TH_HOTEL_BUILD_COMMIT to the current Git commit."/>
<exec executable="git" failonerror="true">
<arg value="rev-parse"/>
<arg value="--verify"/>
<arg value="--quiet"/>
<arg value="${th.hotel.build.commit}^{commit}"/>
</exec>
<exec executable="git" failonerror="true">
<arg value="update-index"/>
<arg value="-q"/>
<arg value="--refresh"/>
</exec>
<exec executable="git" failonerror="true" outputproperty="th.hotel.git.status">
<arg value="status"/>
<arg value="--porcelain"/>
</exec>
<condition property="th.hotel.git.dirty">
<not>
<equals arg1="${th.hotel.git.status}" arg2=""/>
</not>
</condition>
<fail if="th.hotel.git.dirty"
message="Git worktree must be clean before packaging a deployment-proof Jar. Commit or stash changes first. Dirty entries: ${th.hotel.git.status}"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>