Ingress classes and @springbootapplication
Spring boot projects typically have *application entry classes, and the entry class will have the main method, which is the entry method for a standard Java application.
@SpringBootApplication annotations are the core annotations of spring boot, which is actually a combination of annotations:
The annotations are mainly composed of the following annotations:
@SpringBootConfiguration: This is the configuration note for the Spring Boot project, which is also a combined annotation. Recommended @ springbootconfiguration instead of @configuration in spring Boot project
@EnableAutoConfiguration: Enable automatic configuration, which causes spring boot to automatically configure the project's configuration items based on the jar packages that are dependent on the project: for example: We have added spring-boot-starter-web dependencies, The project will also introduce SPRINGMVC dependencies, and Spring boot will automatically configure Tomcat and SPRINGMVC
@ComponentScan: The default scan @springbootapplication is the same as the sibling of the class and its subdirectories.
Turn off automatic configuration
Through the above, we learned that spring boot will be automatically configured based on the jar package dependencies in the project, and spring boot supports automatic configuration as follows (very many):
If we don't need spring boot auto-configuration and want to turn off automatic configuration for an item, how do I set it up?
For example: We do not want to configure Redis automatically and want to configure it manually.
Of course, the rest of the configuration is similar.
Custom Banner
http://www.network-science.de/ascii/
Global configuration file
The Spring Boot Project uses a global configuration file, Application.properties or APPLICATION.YML, under the Resources directory or under the classpath/config, generally we put it under resources.
Modify the Tomcat port to 8088
Restart the app to see the effect:
The core of Spring boot