我正在尝试添加 sbt-native-packager插件到我的 sbt 构建。出于多种原因,我不希望我的构建依赖于默认的 sbt 存储库,我已阻止在网络上访问它们并在我的 <project_home>/project/plugins.sbt
中添加了一个解析器。通过以下方式:
resolvers += "local-repo-plugins" at "file:///" + baseDirectory.value + "/libs/repo/"
resolvers += Resolver.url("my-ivy-proxy-plugins", url("http://fullURLForRepo/"))(Patterns("[organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]") )
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.7.4")
我可以确认它托管在我的 Ivy 代理中的插件,但这甚至不是问题,因为 sbt 仍在尝试转到默认存储库:
[info] Resolving com.typesafe.sbt#sbt-native-packager;0.7.4 ...
[error] Server access Error: Connection timed out url=https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.10/sbt_0.13/0.7.4/ivys/ivy.xml
[error] Server access Error: Connection timed out url=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-native-packager/scala_2.10/sbt_0.13/0.7.4/ivys/ivy.xml
[error] Server access Error: Connection timed out url=https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-native-packager_2.10_0.13/0.7.4/sbt-native-packager-0.7.4.pom
此外,这个完全相同的自定义解析器在我的
<project_home>/build.sbt
上工作得很好(与其他几个解析器一起使用,包括一个基于本地文件系统的解析器)。解决库依赖项时。虽然我理解为什么我的项目构建中使用的解析器与我的
<project_home>/project/plugins.sbt
中使用的不同,关于我刚才描述的问题,我有几个问题:<project_home>/project/plugins.sbt
用那个语法? <project_home>/build.sbt
中定义了完全相同的那些最佳答案
sbt.boot.properties
可能会更容易。 .您可以从 default file 开始对于 0.13.x更改
sbt.boot.properties
应该让您从 Server access errors
. local
typesafe-ivy-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]
maven-central
sonatype-snapshots: https://oss.sonatype.org/content/repositories/snapshots
然后在任何
.sbt
中找到的任何解析器<project_home>/project/
中的文件目录。据我所知,sbt
文件按字母顺序评估,解析器按它们在每个文件中出现的顺序添加。 关于scala - SBT 插件不使用自定义解析器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34044432/