LoginSignup
2

More than 5 years have passed since last update.

Spring Boot 2.0.0 で、組み込みの Tomcat を起動しない

Posted at
  • SpringApplication#setWebEnvironment() が非推奨のため
public class Main {
    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(Main.class);
        app.setWebApplicationType(WebApplicationType.NONE);
        ApplicationContext ctx = app.run(args);
        Main main = ctx.getBean(Main.class);
        // なんか処理
    }
}

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2