《Pro Spring Boot 2》第三章:Spring Boot Internals and Features

@RestController
class WebApp{

    @GetMapping('/')
    String index(){
       "Spring Boot Rocks"
    }
}

 

 Review the output from the command in your terminal. Note all the positive and negative matches that Spring Boot did before running this simple application. Because you are running the Spring Boot CLI, it’s doing a lot by trying to guess what kind of application you want to run. When you create either a Maven or Gradle project, and you specify dependencies (pom.xml or build.gradle, respectively) you are helping Spring Boot to make a decision based on your dependencies.


 @SpringBootApplication annotation inherits @EnableAutoConfiguration, @Configuration, and @ComponentScan,

 

 

 

原文地址:https://www.cnblogs.com/JasonPeng1/p/12266742.html