zoukankan      html  css  js  c++  java
  • IntelliJ IDEA 2017版 SpringBoot的关闭自动配置和自定义Banner

    一、关闭自动配置
    在jar包下找下边的名字
      
    设置关闭自动配置jar
      
    多个的时候配置
       
     
    二、自定义Banner
       (2)命名为Banner.txt,resources目录中
      (3)重启springboot生效
      (4)取消定义的Banner
     1 package com.example.demo;
     2 
     3 import org.springframework.boot.Banner;
     4 import org.springframework.boot.SpringApplication;
     5 import org.springframework.boot.SpringBootConfiguration;
     6 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
     7 import org.springframework.boot.autoconfigure.SpringBootApplication;
     8 import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
     9 import org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfiguration;
    10 import org.springframework.context.annotation.ComponentScan;
    11 import org.springframework.stereotype.Controller;
    12 import org.springframework.web.bind.annotation.RequestMapping;
    13 import org.springframework.web.bind.annotation.ResponseBody;
    14 
    15 
    16 @Controller
    17 @SpringBootApplication(exclude = {RedisAutoConfiguration.class,ServletWebServerFactoryAutoConfiguration.class})
    18 @SpringBootConfiguration
    19 @EnableAutoConfiguration
    20 @ComponentScan
    21 public class Application {
    22 
    23     @RequestMapping("hello")
    24     @ResponseBody
    25     public String hello(){
    26         return "hello world!";
    27     }
    28 
    29     public Application() {
    30     }
    31 
    32     public static void main(String[] args) {
    33 //        SpringApplication.run(Application.class, args);
    34         SpringApplication springApplication = new SpringApplication(Application.class);
    35         springApplication.setBannerMode(Banner.Mode.OFF);
    36         springApplication.run(args);
    37     }
    38 }
    View Code
     
  • 相关阅读:
    HTML <input> 标签
    HTML5 <input> type 属性
    静态页面与动态页面
    string::size_type 页73 size_t 页90
    template method(模板方法)
    C++中创建对象的时候加括号和不加括号的区别(转)
    _declspec(dllexport)和.def(转)
    智能指针
    C++中的delete加深认识
    工厂方法(整理自李建忠<C++设计模式>视频)
  • 原文地址:https://www.cnblogs.com/liuyangfirst/p/8685088.html
Copyright © 2011-2022 走看看