Access a Maven repository located in https
Username and password is stored into your .m2/ folder in a file called settings.xml (create it if you don't have it).
<settings>
<servers>
<server>
<!-- this id should match the id of the repo server in pom.xml -->
<id>myrepo</id>
<username>deployment</username>
<password>password</password>
</server>
</servers>
</settings>
For the second question, it's actually explained in the link you provided, except the keytool link is not working. If I remember right it was posted by a Sun employee in his blog and when Oracle took over the page disappeared. There should be multiple copies of it around the net. One of them is my slightly modified version on GitHub:
The basic concept is that you don't have to find where Firefox stores the certificates, you download it with the tool in a file.
Related videos on Youtube
Luciano
I have been in software development since childhood, and professionally since starting college. I mostly focused on the Java Platform and the following topics interest me (with no particular order): Performance tweaks Security concerns Machine learning Enterprise Application Architecture Twitter profile: @lucianoadrian Facebook profileLinkedin for my CV / Resumé
Updated on June 04, 2022Comments
-
Luciano almost 2 years
I have a Maven project that requires some dependencies that are in a repository located behind HTTPS. I can access the URL by my browser (Firefox) as it asks me a username/password, but in Maven I get Access denied.
Where can I set the username and password so that Maven can use it for that repository? This page deals with certificates and keystores, but I don't have anything like that. Do I need to know where does Firefox stores the certificate for the URL I visited?
-
Luciano over 12 yearsSetting the username and pass in the settings.xml file as you described did the trick. I didn't even need to deal with the certificates. Thanks for the quick response.