Security and Deployment Settings
Repositories to deploy to are defined in a project in the distributionManagement section. However, you cannot put your username, password, or other security settings in that project. For that reason, you should add a server definition to your own settings with an id that matches that of the deployment repository in the project.
In addition, some repositories may require authorisation to download from, so the corresponding settings can be specified in a server element in the same way.
Which settings are required will depend on the type of repository you are deploying to: usually a username and password, or a private key for SSH, in a server whose id matches the repository:
<settings>
.
.
<servers>
<server>
<id>repo1</id>
<username>repouser</username>
<!-- other optional elements:
<password>my_login_password</password>
<privateKey>/path/to/identity</privateKey> (default is ~/.ssh/id_dsa)
<passphrase>my_key_passphrase</passphrase>
-->
</server>
</servers>
.
.
</settings>
For repository URLs, extensions and settings of the HTTP, FTP and SSH transports, see Deploying over HTTP, FTP and SSH.
To encrypt passwords in these sections, refer to Encryption Settings.
Note: The settings descriptor documentation can be found on the Maven Settings Descriptor Model.

