Scala 如何从nexus下载sbt插件?
我遇到了从我的公司nexus获取插件依赖项的问题。具体来说,addSbtPlugin的解析器似乎在路径中查找scala版本和sbt版本,但我找不到在nexus工件上载选项中指定的方法 我在我的plugins.sbt中定义了以下插件:Scala 如何从nexus下载sbt插件?,scala,sbt,nexus,Scala,Sbt,Nexus,我遇到了从我的公司nexus获取插件依赖项的问题。具体来说,addSbtPlugin的解析器似乎在路径中查找scala版本和sbt版本,但我找不到在nexus工件上载选项中指定的方法 我在我的plugins.sbt中定义了以下插件: // The Play plugin addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8") // web plugins addSbtPlugin("com.typesafe.sbt" % "sbt
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")
// web plugins
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.6")
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.0.0")
我还有以下.sbt repositories文件,用于存储库配置:
[repositories]
nexus1: https://nexus.somecorp.com/nexus1/content/repositories/central/content/
nexus2: https://nexus.somecorp.com/nexus2/content/repositories/central/content/
我是这样运行sbt的:
sbt run -Dsbt.override.build.repos=true -Dsbt.repository.config=.sbt-repositories
我的所有常规库依赖项都可以正常下载,但是通过addSbtPlugin添加的sbt插件却不行——它们正在寻找不存在的工件的路径(scala版本和sbt版本)
例如:
[warn] module not found: com.typesafe.play#sbt-plugin;2.3.8
[warn] ==== nexus1: tried
[warn] https://nexus.somecorp.com/nexus1/content/repositories/central/content/com/typesafe/play/sbt-plugin_2.10_0.13/2.3.8/sbt-plugin-2.3.8.pom
不起作用,因为pom文件的正确路径应为:
https://nexus.somecorp.com/nexus1/content/repositories/central/content/com/typesafe/play/sbt-plugin_2.10_0.13/2.3.8/sbt-plugin_2.10_0.13-2.3.8.pom
我还尝试使用ivy的参数将特定的解析器添加到.sbt存储库文件中:
nexus1: https://nexus.somecorp.com/nexus1/content/repositories/central/content/, [organization]/[module]_[scalaVersion]_[sbtVersion]/[revision]/[module]_[scalaVersion]_[sbtVersion]-[artifact](-[classifier]).[ext]
但这也不起作用,原因有二:
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
到您的
插件.sbt
。还请记住,每一行需要在.sbt
文件中用两个换行符分隔。不幸的是,这没有帮助,因为我需要从nexus下载sbt插件,然后我们遇到了与上面相同的问题…可能是一个插件.scala
,并签入使用自定义repos所需的代码?您是否知道与让sbt尊重我的插件相关的文档。scala+仍然使用addSbtPlugin?它与任何其他.scala
构建文件相同。您基本上是在指定元项目。我们将研究它并向您报告。。。同时,我得到了一个建议,用常春藤代理安装nexus