You will need to tell Maven your credentials to access Artifactory.
To obtain your encrypted password from Artifactory, follow these steps:
-
Log in to Artifactory.
-
Click your user name on the top right and from the menu select "Set me up".
-
Select "Maven" as package type (ignore the repository selection and the message about lack of permissions).
-
Enter your login password below and click the unlock button.
-
Click "Generate Settings" at the bottom.
-
Click "Download Snippet".
-
Open the downloaded XML file and look for your encrypted password.
Ignore everything else in this file.
Create the file ~/.m2/settings.xml
(~
representing your user home directory, e.g. /home/yourname
or C:\Users\yourname
) if needed, and make sure it contains the <servers>
element as shown below:
<settings xmlns="https://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>maven.jenkins-ci.org</id> (1)
<username>your_user_name_here</username>
<password>your_encrypted_password_here</password>
</server>
</servers>
</settings>
1 |
This is not a valid host name anymore, but still the ID used by default in the Jenkins plugin parent POM.
You may need to add additional <server> entries if your plugin POM overrides the inherited Maven <distributionManagement> , but this should be rare. |