在build.sbt
凭据中使用admin,我确保密码正确
...
credentials += Credentials("local","localhost:7070","admin","admin123")
publishTo <<= version { (v: String) =>
Some("releases" at "http://localhost:7070/nexus/repository/maven-releases/")
}
...
使用cmd:sbt publish
获取错误
Failed to deploy artifacts: Could not transfer artifact com.lorancechen:rxsocket_2.11:jar:0.9.4 from/to releases (http://localhost:7070/nexus/repository/maven-releases/): Unauthorized (401)
我不知道为什么在使用管理员的情况下获得401。
答案 0 :(得分:0)
尝试更改&#34; local&#34;的域名。到&#34; Sonatype Nexus&#34;。
credentials += Credentials("Sonatype Nexus","localhost:7070","admin","admin123")
请注意,我们会将Nexus 3.1中的域名更改为&#34; Sonatype Nexus Repository Manager&#34;匹配当前的Nexus 2.x领域名称: