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

最后都变了- 提交于 2019-12-19 08:19:03

问题


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 - ANT@1.7.1, IVY@2.1.0, JDK@1.6.0_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.


回答1:


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.



来源:https://stackoverflow.com/questions/3001535/http-authentication-between-using-ant-ivy-retrieving-dependency-from-nexus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!