spring-boot生成git版本库信息
对于使用git管理的spring-boot工程,通过配置git-commit-id-plugin,可以实现生成一份git版本库信息文件,结合spring-boot-actuator提供的端点,能方便的查看线上jar包运行的git版本库相关信息等

使用方式:在spring-boot工程中,修改pom.xml插件配置
maven插件配置代码如下
运行maven打包指令
在打包好的的jar包中,我们就能看到BOOT-INF\classes下会生成一个git.properties文件!

可以打开看到文件内容

此时启动工程,通过spring-boot-starter-actuator提供的/actuator/info端点,可以方便的查看到版本库信息~

示例代码:https://github.com/netbuffer/spring-boot-demo

