mvn --encrypt-master-password does not create a file security-settings.xml.
- Use the command
mvn --encrypt-master-passwordto generate a master password. Remember this password. - Create a new file
security-settings.xmlin${user.home}/.m2/. For example, on Mac OS X or Ubuntu as~/.m2/settings-security.xml.
Write into this file:
<settingsSecurity>
<master>OUTPUT OF THE COMMAND: mvn --encrypt-master-password</master>
</settingsSecurity>e.g.:
<settingsSecurity>
<master>{jSMOWnoPFgsHVpMvz5VrIt5kRbzGpI8u+9EF1iFQyJQ=}</master>
</settingsSecurity>After that the maven encrypt command works on the command line:
mvn --encrypt-password
As mentioned by khmarbaise, more detailed information can be found here: https://maven.apache.org/guides/mini/guide-encryption.html