spring-boot生成打包信息
通过配置spring-boot-maven-plugin,可以实现生成一份maven打包信息文件,来方便查看线上jar包运行的版本信息等
maven插件配置代码如下
运行maven打包指令
在打包好的的jar包中,我们就能看到META-INF下会生成一个build-info.properties文件!

可以打开看到文件内容

另外,可以通过访问spring-boot-starter-actuator提供的/actuator/info端点,来查看到打包信息~

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