Maven - (Password|Credentials)


How to manage credentials:

  • login
  • password

within Maven


Create the master password

  • Encrypt the master password
mvn --encrypt-master-password <MasterPassword>
# or
mvn -emp <MasterPassword>
  • Saved it by creating the file m2_home/.m2/settings-security.xml
      <master>The master password created above {jSMOWnoPFgsHVpMvz5VrIt5kRbzGpI8u+9EF1iFQyJQ=}</master>

Generate password and define credentials

mvn --encrypt-password <Password>
# or
mvn --ep <Password>

And save it in the settings.xml file.

      <password>Oleg reset this password on 2009-03-11, expires on 2009-04-11 {COQLCE6DU6GtcS5P=}</password>

Verify that the server id is the same than in your pom.xml

In the deploy phase, you distribute the artifacts (jar, site, …) on remote server (or repository). The repository id must then correspond to the server id


            <name>Bytle Remote</name>

Documentation / Reference


Given final block not properly padded

[ERROR] Error executing Maven.
[ERROR] javax.crypto.BadPaddingException: Given final block not properly padded
[ERROR] Caused by: Given final block not properly padded

There is a lot of chance that your settings-security.xml file was not saved or is not correct.

Powered by ComboStrap