0

I have a small spring boot project which should be deployed on a wildfly 14. With spring boot 1 all went well, but after migration to spring boot 2 my settings in application.properties are not used.

I have set spring.main.banner-mode="off" but when the war is deployed it shows the banner in console. When starting the project standalone the banner is hidden.

My application class looks like this:

@SpringBootApplication
public class Application extends SpringBootServletInitializer {

  @Override
  protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application.sources(Application.class);
  }

  public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
  }

}

And my application.properties is right under src/main/resources.

Does anyone had the same problem or could gibe me an advice how to solve this?

Benjamin Schüller
  • 2,104
  • 1
  • 17
  • 29

2 Answers2

0

Hi is "off" a typing error ?
Please try:

spring.main.banner-mode=off
Vladimir
  • 612
  • 3
  • 16
0

Try

SpringApplication app = new SpringApplication(Application.class);
app.setBannerMode(Mode.OFF);
app.run(args);

Related question : how to disable spring boot logo in stdout?

Ajinkya
  • 22,324
  • 33
  • 110
  • 161
  • I think this is not such a good solution. It is static and i am afraid that no property of the application.properties is affected in my scenario. – Benjamin Schüller Apr 09 '19 at 11:09