http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-banner http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-banner
new SpringApplicationBuilder()
.showBanner(false)
.sources(Parent.class)
.child(Application.class)
.run(args);
Edit在较新版本的 spring boot(当前为 1.3.3)中,执行此操作的方法是:
1) 应用程序.属性
spring.main.banner-mode=off
2)应用程序.yml
spring:
main:
banner-mode: "off"
3)主要方法
public static void main(String[] args) {
SpringApplication app = new SpringApplication(MySpringConfiguration.class);
app.setBannerMode(Banner.Mode.OFF);
app.run(args);
}
Docs http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-banner
Edit:
要使用环境变量更改此设置,请使用带下划线而不是点的属性。尝试:
SPRING_MAIN_BANNER-MODE=关闭
See the docs https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html用于外部化配置。