Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

http authentication between using ant/ivy retrieving dependency from nexus?

I have an issue when attempting to retrieve a dependency from a nexus repository when running ant with ivy. the dependency is never resolved, when running with verbose output the suspect line is '[ivy:retrieve] authentication: k='@' c='null'.

I have tried many different variations of providing the credentials configuration to ivy, but without changing the result. Stranger still the repo hostname appears to come from the resolver, not from the provided credentials.

Versions - [email protected], [email protected], [email protected]_20

There was a note to ensure that commons-httpclient in on the classpath to allow http authentication, which I am sure it is, although have been unable to confirm explicitly.

Any help is much appreciated.

like image 348
Gareth Avatar asked Oct 26 '22 13:10

Gareth


1 Answers

Are you getting a HTTP 401 error? That would indicate problems with the credentials being used to login to Nexus.

Can be fixed by adding a credentials entry in your ivy settings file:

<credentials host="${nexus.host}" realm="Sonatype Nexus Repository Manager" username="${nexus.user}" passwd="${nexus.pass}" />  

The gotcha is you need to specify the correct Nexus security realm.

like image 93
Mark O'Connor Avatar answered Nov 14 '22 20:11

Mark O'Connor