Run Spring-boot's main using IDE

前端 未结 9 1941
灰色年华
灰色年华 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:12

    Using the profile and instructions below, you can add a profile to maven that allows development in IntelliJ without changing things for other environments.

    
    
        
            org.springframework.boot
            spring-boot-starter-tomcat
                provided
        
    
    
    
        
        
            intellij
            
                
                    org.springframework.boot
                    spring-boot-starter-tomcat
                    compile
                
            
        
    
    

    Click the Maven Projects button on the right side of IntelliJ, and under Profiles, select intellij.

提交回复
热议问题