我有两个 Maven2 配置文件,分别是 selenium 和 jspc。现在,对于“selenium”,我希望能够隐式激活“jspc”,这样我就不用从命令行中编写“mvn -Pselenium,jspc”了。这种情况是否可能?
你不能“链接”配置文件激活(Maven参考),但你可以通过相同的属性激活它们:<activation> <property> <name>profile.selenium</name> </property> </activation> 然后运行mvn -Dprofile.selenium
profile1
继承profile2
继承profile3
,所以上面的方法行不通,因为激活只能使用一个属性。相反,我只需使用maven-enforcer-plugin
和requireProperty
,并将mvn install -Dprofile1,profile2,profile3
粘贴到requireProperty->message中。所以每次我只需要执行mvn install profile3
,就会收到警告并复制输出消息再次运行。 - Ng Sek Long