我需要能够使用在JUnit测试运行时激活的概要文件。我想知道是否有任何方法可以这样做:
String str = System.getProperty("activated.profile[0]");或任何其他相关的方式...
我意识到有一种选择可以使用${project.profiles[0].id},但不知何故它不起作用。
有什么想法吗?
发布于 2019-09-25 14:21:33
我接下来在pom文件中使用的其他案例:
<profiles>
<profile>
<id>a-profile-id</id>
<properties>
<flag>a-flag-value</flag>
</properties>
</profile>
</profiles>在java中:
String flagValue = System.getenv("flag");https://stackoverflow.com/questions/34547962
复制相似问题