当前位置: 首页 > news >正文

慈溪建设企业网站个股期权网站开发

慈溪建设企业网站,个股期权网站开发,学校教育培训机构,上饶市建设局网站SpringBoot 启动输出 Git 版本信息 文章目录 SpringBoot 启动输出 Git 版本信息1. 环境依赖2. pom.xml 配置3. 启动类配置 为了方便记录项目打包时的 Git 版本#xff0c;本文将介绍如何将 Git 版本信息打包进 JAR 文件#xff0c;并在项目启动时输出。 1. 环境依赖 SpringB…SpringBoot 启动输出 Git 版本信息 文章目录 SpringBoot 启动输出 Git 版本信息1. 环境依赖2. pom.xml 配置3. 启动类配置 为了方便记录项目打包时的 Git 版本本文将介绍如何将 Git 版本信息打包进 JAR 文件并在项目启动时输出。 1. 环境依赖 SpringBoot 2.7.13git-commit-id-maven-plugin 4.9.9 2. pom.xml 配置 buildpluginsplugingroupIdio.github.git-commit-id/groupIdartifactIdgit-commit-id-maven-plugin/artifactIdversion4.9.9/versionexecutionsexecutionidget-the-git-infos/idgoalsgoalrevision/goal/goalsphaseinitialize/phase/execution/executionsconfigurationinjectAllReactorProjectsfalse/injectAllReactorProjectsverbosetrue/verboseskipPomstrue/skipPomsgenerateGitPropertiesFiletrue/generateGitPropertiesFilegenerateGitPropertiesFilename${project.build.outputDirectory}/git.properties/generateGitPropertiesFilenamegenerateGitPropertiesFileWithEscapedUnicodefalse/generateGitPropertiesFileWithEscapedUnicodedotGitDirectory${project.basedir}/.git/dotGitDirectoryformatproperties/formatprefixgit/prefixdateFormatyyyy-MM-dd HH:mm:ss/dateFormatdateFormatTimeZone${user.timezone}/dateFormatTimeZonefailOnNoGitDirectoryfalse/failOnNoGitDirectoryfailOnUnableToExtractRepoInfofalse/failOnUnableToExtractRepoInfouseNativeGitfalse/useNativeGitskipfalse/skiprunOnlyOncefalse/runOnlyOncecommitIdGenerationModefull/commitIdGenerationModeevaluateOnCommitHEAD/evaluateOnCommituseBranchNameFromBuildEnvironmenttrue/useBranchNameFromBuildEnvironmentinjectIntoSysPropertiestrue/injectIntoSysPropertiesofflinetrue/offline/configuration/plugin/plugins /build3. 启动类配置 package com.xiaoqqya.gitinfo;import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.info.GitProperties; import org.springframework.context.ConfigurableApplicationContext;/*** Spring boot git info demo.** author a hrefmailto:xiaoQQya126.comxiaoQQya/a* since 2023/07/11*/ SpringBootApplication public class GitInfoApplication {private static final Logger LOGGER LoggerFactory.getLogger(GitInfoApplication.class);public static void main(String[] args) {ConfigurableApplicationContext context SpringApplication.run(GitInfoApplication.class, args);printGitInfo(context);}/*** 输出 Git 版本控制信息.** param context SpringBoot 上下文信息*/private static void printGitInfo(ConfigurableApplicationContext context) {try {if (LOGGER.isInfoEnabled()) {GitProperties gitProperties context.getBean(GitProperties.class);LOGGER.info(Git branch: {}, gitProperties.get(branch));LOGGER.info(Git build time: {}, gitProperties.get(build.time));LOGGER.info(Git commit id: {}, gitProperties.get(commit.id.full));LOGGER.info(Git commit user: {}, gitProperties.get(commit.user.name) gitProperties.get(commit.user.email) );LOGGER.info(Git commit time: {}, gitProperties.get(commit.time));LOGGER.info(Git commit message: {}, gitProperties.get(commit.message.full));}} catch (NoSuchBeanDefinitionException e) {LOGGER.warn(e.getMessage());}} }参考文章 git-commit-id/git-commit-id-maven-plugin (github.com)Injecting Git Information Into Spring Beans | Baeldungspringboot获取项目git版本信息的几种方式_gitproperties_skyhello的博客-CSDN博客
http://www.hkea.cn/news/14462173/

相关文章:

  • 搭建直播网站需要怎么做营销网络建设怎么写
  • 网站建设开发计入二级科目明细企业erp系统
  • 网站主动服务方案要建立网站
  • 做图片网站 服务器手机网站开发样板
  • 网站建设基础摘要食品贸易网站建设案例
  • 沈阳网页建站模板网站经典设计
  • 免费个人网站注册方法不申请域名可以 做网站吗
  • 随州网站建设全包杭州哪家做网站比较好
  • 如何做英文网站的外链网站的设计与维护摘要
  • 通信管理局网站 备案网站网站怎么做代理
  • 建设一个好的网站哈尔滨招标信息网官网
  • 一等一网站湛江网站制作计划
  • 网站建设与代运营介绍免费打广告平台有哪些
  • 发帖秒收录的网站价格低的股票
  • 桂阳网站建设做企业网站到哪里找
  • 电脑做网站用什么软件北京室内设计公司排名榜
  • 电子商务网站实例安徽哪些地方封城了
  • 旅游网站设计与建设论文商品推销
  • 企业网站建设的一般要素群网站建设合同
  • 温州建设小学网站互联网营销行业前景
  • 虞城县住房和城乡建设局网站徐州机票网站开发
  • 网站建设公司长春自媒体发布软件app
  • 广州魔站建站南阳网站托管
  • 网站建设合同制人员招聘邢台短视频推广
  • 淘宝网站制作教程营销培训生
  • 社保网站哪里做转入一个空间建多个网站的方法
  • 双柏县住房和城乡建设局网站成品短视频app下载有哪些
  • 如何提高网站关键词的排名个人做论坛网站要什么证件
  • html 网站开发软件安徽软件开发公司
  • 在linux系统上用什么做网站做平面设计必知的网站