设置sbt程序集v0.14.2的问题

时间:2016-03-14 15:04:10

标签: scala sbt sbt-assembly sbt-native-packager

我正在使用sbt v0.13.9和scala v2.11.7。我已经尝试将sbt程序集插件添加到assembly.sbt以及plugin.sbt但是都没有工作:

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.2")

我尝试将sbt native packager添加到plugin.sbt但是我得到了同样的错误(复制如下):

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.0-RC1"

我的build.sbt中有以下解析器 - 我猜我需要为sbt程序集添加一个解析器(即使该站点上的文档没有提及它的任何内容):

Resolver.sonatypeRepo("public"),
    Resolver.sbtPluginRepo("releases"),
    Resolver.url("bintray-sbt-plugins", url("http://dl.bintray.com/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns),

我得到的错误如下:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.eed3si9n#sbt-assembly;0.14.2: not found
[warn]  :: com.typesafe.sbt#sbt-native-packager;1.1.0-RC1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]      com.eed3si9n:sbt-assembly:0.14.2 (scalaVersion=2.11, sbtVersion=0.13)
[warn]      com.typesafe.sbt:sbt-native-packager:1.1.0-RC1 (scalaVersion=2.11, sbtVersion=0.13)
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      com.eed3si9n:sbt-assembly:0.14.2 (scalaVersion=2.11, sbtVersion=0.13) (/home/test/test-server/plugins.sbt#L4-5)
[warn]        +- com.test:test-server_2.11:1.0.0
[warn]      com.typesafe.sbt:sbt-native-packager:1.1.0-RC1 (scalaVersion=2.11, sbtVersion=0.13) (/home/tets/test-server/plugins.sbt#L6-7)

我是否应该更改scala或sbt版本才能使其正常工作?

1 个答案:

答案 0 :(得分:2)

从上面的错误消息中,看起来你的plugins.sbt在你的项目根目录中 - 它应该在./project/子目录中(即/ home / tets / test-server / project /)。将sbt-assembly的引用放在./project/assembly.sbt中,并在./project/plugins.sbt中引用sbt-native-packager