GH-1069 Ensure 'spring.main.banner-mode' is honored by ServerlessWebApplication
Resolves #1069
This commit is contained in:
@@ -155,6 +155,13 @@ class ServerlessWebApplication extends SpringApplication {
|
||||
private Banner printBanner(ConfigurableEnvironment environment) {
|
||||
ResourceLoader resourceLoader = (this.getResourceLoader() != null) ? this.getResourceLoader()
|
||||
: new DefaultResourceLoader(null);
|
||||
Banner.Mode bannerMode = environment.containsProperty("spring.main.banner-mode")
|
||||
? Banner.Mode.valueOf(environment.getProperty("spring.main.banner-mode").trim().toUpperCase())
|
||||
: Banner.Mode.CONSOLE;
|
||||
|
||||
if (bannerMode == Banner.Mode.OFF) {
|
||||
return null;
|
||||
}
|
||||
SpringApplicationBannerPrinter bannerPrinter = new SpringApplicationBannerPrinter(resourceLoader, new SpringAwsBanner());
|
||||
return bannerPrinter.print(environment, this.getMainApplicationClass(), System.out);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user