2015-12-24 52 views
3

我遇到了从我的公司联系人获取插件依赖关系的问题。具体来说,似乎addSbtPlugin的解析器正在寻找路径中的scala版本和sbt版本,但我找不到在nexus工件上传选项中指定该解决方案的方法。如何从nexus下载sbt插件?

我在plugins.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") 

我也有我使用存储库配置如下名.bst储存库文件:

[repositories] 
    nexus1: https://nexus.somecorp.com/nexus1/content/repositories/central/content/ 
    nexus2: https://nexus.somecorp.com/nexus2/content/repositories/central/content/ 

我跑像这样:

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文件的正确路径应该是:

​​

我也尝试添加特定的解析器我的名.bst储存库文件使用常春藤的参数:

nexus1: https://nexus.somecorp.com/nexus1/content/repositories/central/content/, [organization]/[module]_[scalaVersion]_[sbtVersion]/[revision]/[module]_[scalaVersion]_[sbtVersion]-[artifact](-[classifier]).[ext] 

但这也没有工作,原因有两个:

  1. [组织]解决到前。 com.typesafe.play不适合nexus的com/typesafe/play
  2. 我甚至尝试过对组织值进行硬编码,但后来sbt抱怨神器的pom文件与sbt和scala版本不匹配(还没有找到一种方法来指定关系或在POM文件那些东西)
  3. 。[转]解析.XML常春藤

如何使用与关系是我的仓库SBT插件吗?

万一它很重要,我正在使用sbt 0.13,并且已经通过sbt文档多次阅读以尝试解决此问题。

回答

0

您可以添加

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" 

plugins.sbt。还要记住.sbt文件中每行需要用两条换行符分隔。

+0

不幸的是,这并没有帮助,因为我需要从nexus下载sbt插件,然后我们达到上述相同的问题... – Chuwiey

+0

也许'Plugin.scala'并检查需要使用您的代码定制回购? – Reactormonk

+0

任何你知道与获取sbt有关的文档尊重我的plugin.scala +仍然使用addSbtPlugin? – Chuwiey