Run Spring-boot's main using IDE

前端 未结 9 1938
灰色年华
灰色年华 2020-11-30 01:51

I have a spring-boot application that needs to:

  • Be deployable as a war in a servlet container
  • Be runnable via `mvn spring-boot:run``

I\

9条回答
  •  抹茶落季
    2020-11-30 02:31

    I was able to work around this problem in Intellij IDEA 2017.2 by adding the provided libaray (spring-boot-starter-tomcat) to the project configuration.

    Select File -> Project Structure. Select Libraries and add a new project library (type = From Maven...). Search for spring-boot-starter-tomcat using the dialog, select the correct version and add it by clicking on OK. The library is added to the list of external libraries.

    The disadvantage is that if the Spring Boot version is changed then you will have to remember to delete this library and add the new version.

提交回复
热议问题