一、关闭自动配置
在jar包下找下边的名字
设置关闭自动配置jar
多个的时候配置
二、自定义Banner
(2)命名为Banner.txt,resources目录中
(3)重启springboot生效
(4)取消定义的Banner
package com.example.demo; import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; @Controller
@SpringBootApplication(exclude = {RedisAutoConfiguration.class,ServletWebServerFactoryAutoConfiguration.class})
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan
public class Application { @RequestMapping("hello")
@ResponseBody
public String hello(){
return "hello world!";
} public Application() {
} public static void main(String[] args) {
// SpringApplication.run(Application.class, args);
SpringApplication springApplication = new SpringApplication(Application.class);
springApplication.setBannerMode(Banner.Mode.OFF);
springApplication.run(args);
}
}