Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

specify custom location of maven security-settings.xml file?

Tags:

maven

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.

like image 522
hauron Avatar asked May 21 '14 11:05

hauron


People also ask

Where should I put settings xml in Maven?

The Maven settings file, settings. xml , is usually kept in the . m2 directory inside your home directory.

How do I change settings xml in Maven?

Navigate to path {M2_HOME}\conf\ where M2_HOME is maven installation folder. Open file settings. xml in edit mode in some text editor. Update the desired path in value of this tag.

What is the Maven settings xml file?

A Maven settings. xml file defines values that configure Maven execution in various ways. Most commonly, it is used to define a local repository location, alternate remote repository servers, and authentication information for private repositories.


1 Answers

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>
like image 59
Joe Avatar answered Oct 20 '22 11:10

Joe