Description: A article descritpion how to use the maven master encryption password to encrypt password or secret data that filled in the pom.xml.
I have some maven project that needs authentication to do deployment process, but it’s not safe if i store the raw password in settings.xml.
After some searching on web, below are my tips on process to secure the password.
https://blog.sonatype.com/2009/02/new-feature-maven-settings-password-encryption/
Generate master password
mvn -emp {master-password}
$output: {encrypted master password}
Store the master password in settings-security.xml
<settingsSecurity>
<master>{encrypted master password}</master>
</settingsSecurity>
Generate password
mvn -ep {plain text password}
$output: {encrypted password}
Paste the password on settings.xml
<settings>
<servers>
<server>
<id>nexus</id>
<username>deployment</username>
<password>{encrypted password}</password>
</server>
</servers>
...
</settings>
Further process can be done to provide higher security by relocating the settings-security.xml
Move the settings-security.xml to USB drive
recreate settings-security.xml and append settingsSecurity tag
<settingsSecurity>
<relocation>{path to the new settings-security}</relocation>
</settingsSecurity>