I\'m writing a Spring Boot application that uses one of several @Configuration classes depending on which @Profile is set in the application.
@Configuration
@Profile
application.
The answers from @hzpz and @orid set me on the right track.
I needed to add
@SpringBootApplication(exclude = {EmbeddedServletContainerAutoConfiguration.class, WebMvcAutoConfiguration.class})
and set:
spring.main.web-environment=false
in my application.properties file for the non-Rest cases.
application.properties