如果应用程序在嵌入式容器中运行,我希望创建 @Bean。如果应用程序在外部 tomcat 上运行,则不应创建该 bean。有什么办法我们可以创建 @Conditional 注释来仅当应用程序在嵌入式 tomcat 中运行时创建 bean。
spring-boot
spring-boot ×1