Open utterances-bot opened 3 months ago
示例:
<!-- git-commit-id-maven-plugin :打包的时候携带git提交信息 -->
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>5.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.json
</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
<includeOnlyProperty>^git.branch</includeOnlyProperty>
<includeOnlyProperty>^git.commit.user.name</includeOnlyProperty>
<includeOnlyProperty>^git.commit.user.email</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
</configuration>
</plugin>
Spring Boot 使用 git-commit-id-maven-plugin 打包应用 - spring 中文网
本文介绍了如何使用 git-commit-id-maven-plugin maven 插件,在打包 Spring Boot 应用时把 git-commit 信息打包到 Jar 中
https://springdoc.cn/spring-boot-build-with-git-commit-id-maven-plugin/