gpt4 book ai didi

scala - Play Framework 和 sbt : passing credentials to a nexus passowrd protected repo

转载 作者:行者123 更新时间:2023-12-04 13:17:12 26 4
gpt4 key购买 nike

我需要将以下库定义为依赖项:

网址:http://deploy.cloud.testmx.com:8081/nexus/content/groups/public/

用户:testmx

通过:testmx@testmx

组 ID:testmx

artifactId:testmxcommons

版本:1.0.0-SNAPSHOT

所以我定义了以下项目/Build.scala

import sbt._
import Keys._
import PlayProject._

object ApplicationBuild extends Build {

val appName = "testmxproject"
val appVersion = "1.0-SNAPSHOT"

val appDependencies = Seq(
"mysql" % "mysql-connector-java" % "5.1.18",
"testmx" % "testmxcommons" % "1.0.0-SNAPSHOT"
)

val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
credentials += ("testmx public", "deploy.cloud.testmx.com:8081", "testmx", "testmx@testmx"),
resolvers += "testmx public" at "http://deploy.cloud.testmx.com:8081/nexus/content/groups/public/"
)

}

我收到以下错误:
[warn]  module not found: testmx#testmxcommons;1.0.0-SNAPSHOT

[warn] ==== testmx public: tried
[warn] http://deploy.cloud.testmx.com:8081/nexus/content/groups/public/testmx/textmxcommons/1.0.0-SNAPSHOT/textmxcommons-1.0.0-SNAPSHOT.pom

我尝试了几种替代方法,但它们给了我同样的错误......

我查过 this article这个 SO question

并尝试将用户名和密码保存在外部文件中,如 here 中所述和 here .

任何的想法?

-- 编辑澄清 --

我更改了真实的网址,因为它不是我正在使用的公共(public) repo ......真实的网址在那里,并且 sbt 试图找到的 pom 确实存在......

ps:顺便说一句.. sbt scaladocs 在哪里???

最佳答案

您需要告诉 SBT 您要发布到哪个存储库:

publishTo := Some("testmx public" at "http://deploy.cloud.testmx.com:8081/nexus")

此外,如果您不想将凭据保留在 Build 文件中,可以通过添加以下行告诉它在本地检索它们:
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),

在您的 ~/.ivy2目录创建 .credentials像这样的文件:
realm=Sonatype Nexus Repository Manager
host=deploy.cloud.testmx.com
user=testmx
password=testmx@testmx

https://github.com/harrah/xsbt/wiki/Publishing更多

关于scala - Play Framework 和 sbt : passing credentials to a nexus passowrd protected repo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10905695/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com