我已经声明了一些特定于Maven配置文件的属性。我的pom.xml的一部分:IntelliJ:在运行Junit测试时激活Maven配置文件
<profiles>
<profile>
<id>release</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<my.properties.file>foo.xml</my.properties.file>
</properties>
</profile>
<profile>
<id>ci</id>
<properties>
<my.properties.file>bar.xml</my.properties.file>
</properties>
</profile>
</profiles>
我遇到一些问题,当我通过IntelliJ IDEA的开始JUnit测试使用了“CI” Maven的轮廓2016
我激活通过“Maven项目”面板中我的个人资料,然后我开始测试。问题是“my.properties.file”属性值等于“foo.xml”,而不是“bar.xml”。
我对命令行没有问题(我可以使用“-Pci”标志)。我如何告诉IntelliJ使用“ci”配置文件?谢谢。
在Maven Projects面板中,当您在树视图中打开配置文件时,是否显示带有或不带复选框的配置文件?你可以用复选框打开和关闭它吗?如果不是,那么配置文件可能会绑定到环境中的某个东西,如属性值。 –