如何利用PDF智能建站工具创建专业网站案例详解?

摘要:网站开发案例详解pdf,智能建网站,手机建设网站赚钱,kali做钓鱼网站SpringBoot 启动输出 Git 版本信息 文章目录 SpringBoot 启动输出 Git 版本信息1. 环境依赖2. pom.xml 配置3. 启动类配置 为
网站开发案例详解pdf,智能建网站,手机建设网站赚钱,kali做钓鱼网站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博客