简体   繁体   中英

Use Spring Boot with explicitly configuration

Is it possible to use Spring Boot so that all configurations are explicitly in the main class?

For example, is it possible to tell spring-boot to print all autoconfigurations make by @SpringBootApplication so that I can copy paste in my main class?

Or is it possible to copy then from somewhere into the main?

You can have Spring Boot create a report (a list of auto configurations) simply by enabling debug mode in your application.properties file:

debug = true

The auto-configuration report contains information about the classes that Spring Boot found on the classpath and configured automatically. It also shows information about classes that are known to Spring Boot but were not found on the classpath.

And, because you've set debug=true in application.properties or application.yml , so you will see it in your output.

There is no way of doing this. Either you embrace the devil and suffer the consequences latter if you need to personalize something unpredictable by spring boot developers or you don't use it's magic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM