Maven - (Password|Credentials)

Card Puncher Data Processing


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.

Discover More
Card Puncher Data Processing
Maven - (Remote Repository|Server)

Remote repository in maven A remote repository (or server) can be defined as: a source to resolve dependency (via HTTP) or as a target to deploy the artifact (via SCP) The definition dependent on...
Card Puncher Data Processing
Maven - Distribution Management

The distribution Management pom.xml section is responsible to define: the remote repositories how to deploy the project's site and documentation....
Card Puncher Data Processing
Maven - Settings.xml - (User|Local) Configuration

Settings.xml is a configuration file that should not be bundled to any specific project pom.xml It contains: configuration information such as the local repository location authentication information...

Share this page:
Follow us:
Task Runner