假设我有一些Maven配置文件和一些Spring配置文件。我想在一个应用程序(spring-profile).yaml中管理我的所有配置文件。可以从Spring配置文件激活Maven配置文件吗?我读到了关于从Maven激活Spring配置文件的信息,但我还没有找到任何关于从Spring激活Maven配置文件的内容。
示例
pom.xml
<profiles>
<profile>
<id>integration-tests</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
... (in my case some Postman Collections)
</build>
</profile>
</profiles>manifest-dev.yaml
spring:
profiles:
active: integration-tests, other-spring-profile在本例中,Maven profile integration-tests被激活为Spring profile。我正在寻找一种更好的声明方式来激活application.yaml文件中的Maven
发布于 2021-11-11 12:19:30
在application.properties集合中
spring.profile = ${yourActiveSpringProfile}你可以在How to set spring active profiles with maven profiles上看到一些东西
https://stackoverflow.com/questions/69926832
复制相似问题