Spring Boot without the web server

后端 未结 16 840
眼角桃花
眼角桃花 2020-11-29 16:50

I have a simple Spring Boot application that gets messages from a JMS queue and saves some data to a log file, but does not need a web server. Is there any way of starting S

16条回答
  •  北荒
    北荒 (楼主)
    2020-11-29 17:00

    If you need web functionality in your application (like org.springframework.web.client.RestTemplate for REST calls) but you don't want to start a TOMCAT server, just exclude it in the POM:

    
        org.springframework.boot
        spring-boot-starter-web
        
            
                org.springframework.boot
                spring-boot-starter-tomcat
            
        
    
    

提交回复
热议问题