假设我有一些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配置文件integration-tests
在示例中被激活为Spring配置文件。我正在寻找一种最好的声明方式来激活应用程序中的Maven配置文件。yaml文件
在application.properties
中设置
spring.profile = ${yourActiveSpringProfile}
你可以在如何使用maven配置文件设置春季活动配置文件上看到一些内容