错误讯息:
java.io.IOException: Access to URL
http://maven.company.com/repository/internal/com/company/
project_2.10/0.0.3/project_2.10-0.0.3.pom was
refused by the server: Unauthorized
运行Apache Archiva 1.4-M4(最新版),我可以通过网络界面上传,但不能通过SBT上传。
在SBT中使用这些设置:
publishTo := Some("company releases" at "http://maven.company.com/repository/internal"),
credentials += Credentials(
"company Maven Repository",
"maven.company.com",
"username",
"password"
),
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ => true },
// .. some xml with author details
}
所有详细信息,包括用户名,密码和网址都是正确的。
答案 0 :(得分:6)
安全王国对常春藤很重要。它就像是唯一要求您使用有效安全领域的依赖管理器。我相信apache archiva是“Repository Archiva Managed”。您可以通过尝试向Archiva发出自己的HTTP请求进行检查,并查看它支持的Realms。
<强>更新强>: 领域看起来像:“Repository Archiva Managed internal Repository”。如果您发布到其他repos,请将“internal”替换为repo的名称。
确定安全领域后,您需要按如下方式更新构建:
credentials += Credentials(
"Repository Archiva Managed internal Repository", // Or whatever you detect as the security realm
"maven.company.com",
"username",
"password"
),