指定maven security-settings.xml文件的自定义位置?

hau*_*ron 11 maven

使用maven,您可以轻松指定settings.xml位置,例如:

mvn -s custom/dir/settings.xml package
Run Code Online (Sandbox Code Playgroud)

是否有类似的方法来指定自定义security-settings.xml?

这背后的原因很简单:通过本地存储库轻松分发它.现在,安全性并不是一个问题 - 它都在内部网上.

Joe*_*Joe 17

这被要求作为MNG-4853.虽然没有直接实现,但建议使用解决方法:

我已经证实-Dsettings.security=path/to/security-settings.xml有效

公告博客文章中所述,您还可以使用主密码重定位功能.写一个~/.m2/security-settings.xml带有重定向的文件:

<settingsSecurity>
  <relocation>/Volumes/mySecureUsb/secret/settings-security.xml</relocation>
</settingsSecurity>
Run Code Online (Sandbox Code Playgroud)

  • [MNG-5438](https://issues.apache.org/jira/browse/MNG-5438)还有一个命令行选项补丁. (2认同)