20

with maven you can easily specify settings.xml location, e.g:

mvn -s custom/dir/settings.xml package

Is there a similiar way to specify custom security-settings.xml?

The reasoning behind this is simple: to easily distribute it via a local repository. Now, security is NOT a concern - it's all on the intranet.

1 Answer 1

31

This was requested as MNG-4853. Although not implemented directly, a workaround is suggested:

I've verified that -Dsettings.security=path/to/security-settings.xml works

As detailed in the announcement blog post, you can also use the master password relocation feature. Write an ~/.m2/security-settings.xml file with a redirection in it:

<settingsSecurity>
  <relocation>/Volumes/mySecureUsb/secret/settings-security.xml</relocation>
</settingsSecurity>
2
  • 3
    There is also MNG-5438 with a patch for a command-line option.
    – Tunaki
    Commented Sep 28, 2016 at 12:06
  • mvn -ep REPOSITORY_PASSWORD -Dsettings.security=path/to/security-settings.xml Commented Dec 24, 2020 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.