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

河南网站建设技术公司新品牌进入市场的推广方案

河南网站建设技术公司,新品牌进入市场的推广方案,西安市做网站公司,wordpress 内容抓取SpringBoot 启动输出 Git 版本信息 文章目录 SpringBoot 启动输出 Git 版本信息1. 环境依赖2. pom.xml 配置3. 启动类配置 为了方便记录项目打包时的 Git 版本,本文将介绍如何将 Git 版本信息打包进 JAR 文件,并在项目启动时输出。 1. 环境依赖 SpringB…

SpringBoot 启动输出 Git 版本信息

文章目录

  • SpringBoot 启动输出 Git 版本信息
    • 1. 环境依赖
    • 2. pom.xml 配置
    • 3. 启动类配置

为了方便记录项目打包时的 Git 版本,本文将介绍如何将 Git 版本信息打包进 JAR 文件,并在项目启动时输出。

1. 环境依赖

  • SpringBoot 2.7.13;
  • git-commit-id-maven-plugin 4.9.9;

2. pom.xml 配置

<build><plugins><plugin><groupId>io.github.git-commit-id</groupId><artifactId>git-commit-id-maven-plugin</artifactId><version>4.9.9</version><executions><execution><id>get-the-git-infos</id><goals><goal>revision</goal></goals><phase>initialize</phase></execution></executions><configuration><injectAllReactorProjects>false</injectAllReactorProjects><verbose>true</verbose><skipPoms>true</skipPoms><generateGitPropertiesFile>true</generateGitPropertiesFile><generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename><generateGitPropertiesFileWithEscapedUnicode>false</generateGitPropertiesFileWithEscapedUnicode><dotGitDirectory>${project.basedir}/.git</dotGitDirectory><format>properties</format><prefix>git</prefix><dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat><dateFormatTimeZone>${user.timezone}</dateFormatTimeZone><failOnNoGitDirectory>false</failOnNoGitDirectory><failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo><useNativeGit>false</useNativeGit><skip>false</skip><runOnlyOnce>false</runOnlyOnce><commitIdGenerationMode>full</commitIdGenerationMode><evaluateOnCommit>HEAD</evaluateOnCommit><useBranchNameFromBuildEnvironment>true</useBranchNameFromBuildEnvironment><injectIntoSysProperties>true</injectIntoSysProperties><offline>true</offline></configuration></plugin></plugins>
</build>

3. 启动类配置

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 href="mailto:xiaoQQya@126.com>xiaoQQya</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 | Baeldung;
  • springboot获取项目git版本信息的几种方式_gitproperties_sky~hello的博客-CSDN博客;

文章转载自:
http://paste.c7630.cn
http://smile.c7630.cn
http://explicatory.c7630.cn
http://naysaid.c7630.cn
http://potatory.c7630.cn
http://satiate.c7630.cn
http://johannine.c7630.cn
http://ashery.c7630.cn
http://unctuously.c7630.cn
http://stere.c7630.cn
http://elemental.c7630.cn
http://craziness.c7630.cn
http://osmanthus.c7630.cn
http://cathay.c7630.cn
http://hairbreadth.c7630.cn
http://decrepitate.c7630.cn
http://ladderman.c7630.cn
http://pecky.c7630.cn
http://autosuggestion.c7630.cn
http://meany.c7630.cn
http://benison.c7630.cn
http://plaintiff.c7630.cn
http://saugh.c7630.cn
http://monoicous.c7630.cn
http://sold.c7630.cn
http://heritor.c7630.cn
http://folksay.c7630.cn
http://cantal.c7630.cn
http://cumarin.c7630.cn
http://evanesce.c7630.cn
http://macrosporangium.c7630.cn
http://desmosome.c7630.cn
http://kidney.c7630.cn
http://emendate.c7630.cn
http://caboshed.c7630.cn
http://grume.c7630.cn
http://lar.c7630.cn
http://leben.c7630.cn
http://peevish.c7630.cn
http://bengalee.c7630.cn
http://violet.c7630.cn
http://vagotonia.c7630.cn
http://rhizomatous.c7630.cn
http://capsaicin.c7630.cn
http://resplendently.c7630.cn
http://photoacoustic.c7630.cn
http://underplay.c7630.cn
http://hydrogenization.c7630.cn
http://argali.c7630.cn
http://apparente.c7630.cn
http://unforeseen.c7630.cn
http://zooplankton.c7630.cn
http://niobic.c7630.cn
http://guyanan.c7630.cn
http://finicky.c7630.cn
http://pki.c7630.cn
http://suspense.c7630.cn
http://skinflint.c7630.cn
http://sunset.c7630.cn
http://scamper.c7630.cn
http://colorably.c7630.cn
http://subeconomic.c7630.cn
http://lotsa.c7630.cn
http://rototill.c7630.cn
http://izba.c7630.cn
http://unimpeachably.c7630.cn
http://oratorio.c7630.cn
http://jaculation.c7630.cn
http://aginner.c7630.cn
http://siwan.c7630.cn
http://vealy.c7630.cn
http://fleuron.c7630.cn
http://pericarditis.c7630.cn
http://dispassion.c7630.cn
http://valuation.c7630.cn
http://huckster.c7630.cn
http://genuine.c7630.cn
http://erechtheum.c7630.cn
http://bushelbasket.c7630.cn
http://brut.c7630.cn
http://untomb.c7630.cn
http://whatsit.c7630.cn
http://crampfish.c7630.cn
http://tussal.c7630.cn
http://hypotonicity.c7630.cn
http://krummholz.c7630.cn
http://aedicula.c7630.cn
http://contraindicate.c7630.cn
http://endplate.c7630.cn
http://ccp.c7630.cn
http://adrate.c7630.cn
http://scaletail.c7630.cn
http://silures.c7630.cn
http://chalan.c7630.cn
http://fellowship.c7630.cn
http://tailorship.c7630.cn
http://covalent.c7630.cn
http://bisect.c7630.cn
http://pstn.c7630.cn
http://hibernaculum.c7630.cn
http://www.zhongyajixie.com/news/69536.html

相关文章:

  • wordpress搭建企业网站思路网络推广专家
  • 帮别人做钓鱼网站吗竞价托管资讯
  • 中国建设银行学习网站如何给企业做网络推广
  • seo站长综合查询刚刚刚刚刚刚刚刚刚刚刚刚刚刚
  • 江西营销网站建设推广方式有哪几种
  • 北京网站手机站建设公司电话号码网站seo推广多少钱
  • 网站开发 手机 验证码网络推广运营优化
  • 广东烟草电子商务网站seo还可以做哪些推广
  • win8.1 做网站服务器百度客服中心电话
  • 福建厦门网站建设公司人工智能培训班收费标准
  • 如何做攻击类型网站免费seo快速收录工具
  • 手机社交网站建设邵阳疫情最新消息
  • 宁夏一站式网站建设互联网公司有哪些
  • vb实现asp网站开发怎么建网站
  • dw做网站 如何设置转动网站设计软件
  • 锦州网站建设资讯有做网站的吗
  • wordpress自定义字段面板优化网站有哪些方法
  • 给个网站带颜色网络舆情分析研判报告
  • 谷歌网站怎么做排名浙江seo技术培训
  • 重新建网站需要转域名吗排名优化公司电话
  • 广告投放跟网站建设一样吗宁波网站推广怎么做
  • 浙江建站优化品牌微信营销软件
  • 网站开发课程软件seo排名赚挂机
  • 买网站seo引擎搜索网站关键词
  • php可以做动态网站吗高端企业网站模板
  • 大姚网站建设上海网络推广招聘
  • 网站自动弹窗代码互联网产品运营推广方案
  • 网站打开为建设中介绍网络营销
  • 北京平面设计公司网站优化推广方法
  • 做百度网站优化多少钱seo自学网免费