We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9cb91f8 commit f5d3978Copy full SHA for f5d3978
IX. ‘How-to’ guides/80.2 Generate git information.md
@@ -1 +1,19 @@
1
-###80.2 Generate git information
+###80.2 生成Git信息
2
+
3
+Maven和Gradle都支持生成一个`git.properties`文件,该文件包含项目构建时`git`源码的仓库状态。对于Maven用户来说,`spring-boot-starter-parent` POM包含一个预配置的插件去产生一个`git.properties`文件,只需简单的将以下声明添加到POM中:
4
+```xml
5
+<build>
6
+ <plugins>
7
+ <plugin>
8
+ <groupId>pl.project13.maven</groupId>
9
+ <artifactId>git-commit-id-plugin</artifactId>
10
+ </plugin>
11
+ </plugins>
12
+</build>
13
+```
14
+Gradle用户可以使用[gradle-git-properties](https://plugins.gradle.org/plugin/com.gorylenko.gradle-git-properties)插件实现相同效果:
15
+```gralde
16
+plugins {
17
+ id "com.gorylenko.gradle-git-properties" version "1.4.6"
18
+}
19
0 commit comments