2016-03-16 20 views
0

我們需要設置一個Maven配置文件通過IntelliJ爲JUnit測試套件提供作業配置,但我們無法通過參數列表傳遞配置文件。是否可以選擇maven配置文件低谷設置環境變量像`PROFILE = test?從環境中選擇配置文件maven

回答

1

要使用環境變量試試這個(從here):

<profiles> 
    <profile> 
     <activation> 
     <property> 
      <name>env.PROFILE</name> 
      <value>SOME_ENVIRONMENT</value> 
     </property> 
     </activation> 
     <!-- ... --> 
    </profile> 
</profiles> 

要使用系統屬性PROFILE剛落env.