Browse Source

git版本号插件添加

mazq 1 năm trước cách đây
mục cha
commit
cab7346dfe
1 tập tin đã thay đổi với 26 bổ sung0 xóa
  1. 26 0
      dcuc-app-service/pom.xml

+ 26 - 0
dcuc-app-service/pom.xml

@@ -303,6 +303,32 @@
                             <testFailureIgnore>true</testFailureIgnore>
                         </configuration>
                     </plugin>
+                    <!--生成git-infos.properties 版本文件-->
+                    <plugin>
+                        <groupId>pl.project13.maven</groupId>
+                        <artifactId>git-commit-id-plugin</artifactId>
+                        <version>4.9.10</version>
+                        <executions>
+                            <execution>
+                                <id>get-the-git-infos</id>
+                                <goals>
+                                    <goal>revision</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <abbrevLength>8</abbrevLength>
+                            <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
+                            <generateGitPropertiesFile>true</generateGitPropertiesFile>
+                            <includeOnlyProperties>
+                                <includeOnlyProperty>^git.branch</includeOnlyProperty>
+                                <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
+                                <includeOnlyProperty>^git.commit.(id|id.abbrev|message.full)*</includeOnlyProperty>
+                            </includeOnlyProperties>
+                            <generateGitPropertiesFilename>${project.build.outputDirectory}/git-infos.properties
+                            </generateGitPropertiesFilename>
+                        </configuration>
+                    </plugin>
                 </plugins>
             </build>
         </profile>