sbt: publish to corporate Nexus repository unauthorized

非 Y 不嫁゛ 提交于 2019-12-02 16:19:58

Ivy uses the realm of the WWW-Authenticate header, which will have to match byte-for-byte equal to the one configured in your credentials file.

sbt-aether-deploy uses the same header, but uses Aether as its deployment mechanism. Ivy does not.

The easiest way of figuring out the value of the WWW-Authenticate header is by using cURL.

curl -X POST http://nexus/content/repositories/libs-snapshots -v > /dev/null

cURL will prompt you for a user and pass.

-v will add verbosity so you will be able to see the headers of the request and response.

JasonG

I suspect that your credentials file path may be incorrect. Try changing this:

credentials += Credentials(Path.userHome / ".sbt" / ".credentials")

to that:

credentials += Credentials("c:/data/user/.sbt/.credentials")

or try directly to troubleshoot first:

credentials += Credentials("Sonatype Nexus Repository Manager", 
  "nexus.scala-tools.org", "admin", "admin123") 

If these don't work check that your credentials are valid.

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