简体   繁体   English

如何自定义Spring Boot标语?

[英]How to customize the spring boot banner?

Even though I am placing banner.txt in src/main/resources I am not able to customize the spring boot banner. 即使我将banner.txt放在src/main/resources也无法自定义spring boot标题。

This is my directory tree : 这是我的目录树:

D:.
├───.gradle
│   ├───4.8
│   │   ├───fileChanges
│   │   ├───fileContent
│   │   ├───fileHashes
│   │   └───taskHistory
│   ├───buildOutputCleanup
│   └───vcsWorkingDirs
├───build
│   ├───classes
│   │   └───java
│   │       └───main
│   │           └───hello
│   ├───libs
│   ├───resources
│   │   └───main
│   └───tmp
│       ├───bootJar
│       ├───compileJava
│       └───compileTestJava
├───gradle
│   └───wrapper
└───src
    └───main
        ├───java
        │   └───hello
        └───resources

I tried modifying properties but it did not work 我尝试修改属性,但是没有用

'banner.txt' is the default name and 'src/main/resourses' is the default location but any can be used as long as it is configured in the properties file. “ banner.txt”是默认名称,“ src / main / resourses”是默认位置,但是只要在属性文件中进行配置,都可以使用任何位置。

There are a couple reasons you could be having issues. 您可能会遇到问题的原因有两个。 There could be an error in your 'banner.txt' file, so make sure that this file is correct. 您的“ banner.txt”文件中可能存在错误,因此请确保该文件正确无误。 If no banner is showing at all then make sure you do not have the 'banner-mode' setting turned off. 如果根本没有显示横幅,请确保您没有关闭“横幅模式”设置。

I would also just do a clean build to make sure your configurations have been updated. 我也将进行干净的构建以确保您的配置已更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM