Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass in credentials when connecting to sonatype nexus (anonymous login disabled)?

In eclipse, the m2eclipse plugin will prompt me for my credentials when I'm building a maven2 project. And it compiles fine.

But if I now try to run "mvn install" from the command line, I get an artifact not found error. How do I add the username/password into my pom.xml in order to solve this problem.

like image 997
Jacques René Mesrine Avatar asked Jan 23 '23 15:01

Jacques René Mesrine


2 Answers

Which username password you talking about? If its the username defined in nexus repository then you can define in settings.xml where you defined the nexus repository.

<servers>
  <server>
    <id>releases</id>
    <username>xxxxxxxxx</username>
    <password>yyyyyyyy</password>
  </server>
</servers>
like image 154
Bhushan Bhangale Avatar answered Jan 29 '23 16:01

Bhushan Bhangale


As far as I know there are no maven xml tags to configure that. Of course you could try prefixing the domain name with username and password like so:

http://username:password@yournexusserver/..
like image 34
Kees de Kooter Avatar answered Jan 29 '23 16:01

Kees de Kooter