我有一个基本授权的我的maven仓库的nginx.
我的build.sbt有:
credentials += Credentials("maven repository","rep.com","sbt","password") resolvers ++= Seq( "maven repository" at "http://rep.com:8080/" )
但是,sbt找不到模块,因为sbt不使用基本的授权.
我的nginx日志看起来像:
012/07/22 20:02:21 [error] 3338#0: *14 no user/password was provided for basic authentication,client: 8.32.39.29,server: rep.com,request: "HEAD /some/cool_2.9.1/0.1-SNAPSHOT/cool_2.9.1-0.1-SNAPSHOT.pom HTTP/1.1",host: "rep.com:8080"
我不想通过nginx发布文物.基本认证只需要限制对工件的访问.
我如何限制访问和使用sbt中的存储库?
如何将以下内容添加到〜/ .ivy2 / .credentials中:
realm=maven repository host=rep.com:8080 user=username password=password
然后使用Credentials(Path.userHome /“.ivy2”/“.credentials”)
您需要确保您的领域配置正确:curl http://rep.com:8080 -vv 2>& 1 | egrep“realm | host”(我可能会误会,但是’host’可能需要匹配主机头,即rep.com:8080,而不仅仅是rep.com).
心连心