-- https://mvnrepository.com/artifact/pl.project13.maven/git-commit-id-plugin --><groupId>pl.project13.maven</groupId><artifactId>git-commit-id-plugin</artifactId><version>4.0.5</version><executions><execution><goals><goal>revision</goal></goals></execution></executions><!-- 配置选项 ...
maven配置里面的buil标签下,添加git-commit-id-plugin插件,然后修改maven-war-plugin插件里面的war包名称,完整示例如下: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.3.1</version> <configuration> <!-- 设置WAR包的文件名...
使用Maven git-commit-id插件,版本信息可以随时检索并始终保持最新,无需每次都手动去修改版本信息。 插件目标、参数 git-commit-id:revision:将构建时的信息保存到指定文件中或maven的属性中,默认绑定生命周期的阶段(phase):initialize git-commit-id:validateRevision:校验属性是否符合预期值,默认绑定阶段...
该插件 git-commit-id-plugin 可以很方便将打包时的git信息生成文件在包中,可以很方便的查看,官方文档地址:https://github.com/git-commit-id/git-commit-id-maven-plugin/blob/master/maven/docs/using-the-plugin.md 以下是简单的翻译,最后有使用到的配置 <plugin> <groupId>pl.project13.maven</groupId> ...
笔者甚至在github上找到了这样一个demomygitcommitiplanet思路是: 1)把maven-git-commit-id-plugin运行所产生的git.properties文件的内容修改为json形式。 2)通过“/version” 的接口对外提供查询服务。 后续,甚至都可以通过这个接口来检查线上系统的版本和cmdb中版本的一致性,或者做系统的健康性巡检(ping)。果然只有...
mygitcommitidplanet 思路是: 1)把maven-git-commit-id-plugin运行所产生的git.properties文件的内容修改为json形式。 2)通过“/version” 的接口对外提供查询服务。 后续,甚至都可以通过这个接口来检查线上系统的版本和cmdb中版本的一致性,或者做系统的健康性巡检(ping)。果然只有想不到,没有做不到。 接口示例:...
-- 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>...
<artifactId>git-commit-id-plugin</artifactId> <version>2.2.4</version> <executions> <execution> <id>get-the-git-infos</id> <goals> <goal>revision</goal> </goals> </execution> </executions> <configuration> <dotGitDirectory>${project.basedir}/.git</dotGitDirectory> ...
git.branch=${git.branch} git.commit.id.describe=${git.commit.id.describe} git.build.user.name=${git.build.user.name} git.build.user.email=${git.build.user.email} git.build.time=${git.build.time} git.commit.id=${git.commit.id} git.commit.id.abbrev=${commit.id.abbrev} git.commit...
五、maven打包把git信息打进jar包: 其他参考附录: 一、Maven 1、windows 建议使用apache-maven-3.6.或更高稳定版本都可以,没有特殊要求,大多数情况下都能满足开发需要,有特殊需要建议更高稳定版本,作者使用的是apache-maven-3.8.*的版本。 2、linux