2014-05-21 42 views
9

與Maven可以很容易地指定的settings.xml位置,e.g:指定maven security-settings.xml文件的自定義位置?

mvn -s custom/dir/settings.xml package 

是否有指定自定義安全settings.xml的一個類似的方式?

這背後的推理很簡單:通過本地存儲庫輕鬆分發。現在,安全並不是一個問題 - 全部都在Intranet上。

回答

11

這被要求爲MNG-4853。雖然沒有直接實施,解決方法建議:

我驗證過-Dsettings.security=path/to/security-settings.xml工作

正如the announcement blog post詳細介紹,您也可以使用主密碼重定位功能。寫一個文件~/.m2/security-settings.xml與重定向在它:

<settingsSecurity> 
    <relocation>/Volumes/mySecureUsb/secret/settings-security.xml</relocation> 
</settingsSecurity> 
+2

還有[MNG-5438](https://issues.apache.org/jira/browse/MNG-5438)具有用於命令 - 的貼劑線路選項。 – Tunaki