I have a Spring boot app with different profiles with their own yaml configurations. My app is a web application with embedded tomcat serving rest requests.
I have a certain profile and when I activate it, it only scans certain packages. I want my app to terminate after the beans under those packages finish their jobs. However, spring-boot-starter-web may be blocking this since it keeps the app running to serve requests. Basically I'm trying to turn my web app into a console app (do the job then terminate) with a profile change.
For this, I tried excluding some autoconfigurations of spring-boot-starter-web but did not work, the app stil does not terminate:
spring:
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.web.embedded.EmbeddedWebServerFactoryCustomizerAutoConfiguration
...
Can you help me achieve this?
Thank you