到目前为止,我一直在用 SBT(通过 Typesafe 堆栈)编译我的 Scala 项目。我现在想通过sbt-assembly在多台机器上运行代码。按照指示,我所做的唯一一项更改是在我的project/Build.scala
文件中。以下是相关部分:
resolvers += "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases",
resolvers += "artifactory" at "http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases",
libraryDependencies += "com.eed3si9n" % "sbt-assembly" % "0.8.3"
但是,当我运行sbt compile
时,出现此错误:
sbt.ResolveException: unresolved dependency: com.eed3si9n#sbt-assembly/scala_2.9.1/sbt_0.11.2;0.8.3: not found
.
我究竟做错了什么?
谢谢!
编辑在与(folder is )build.sbt
相同的文件夹中
创建了一个文件,并在其中包含以下两行:Build.scala
/project/
Seq[Setting[_]](resolvers += "artifactory" at "http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases",
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.8.3"))
现在错误是:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.eed3si9n#sbt-assembly;0.8.3: 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.8.3 (sbtVersion=0.11.2, scalaVersion=2.9.1)
[warn]
[error] {file:/Users/myname/current/projectname/project/}default-d7da9a/*:update: sbt.ResolveException: unresolved dependency: com.eed3si9n#sbt-assembly;0.8.3: not found
编辑 2
嗯,在我成功之后sbt compile
,我应该能够进入sbt
控制台并输入assembly
吗?
> assembly
[error] Not a valid command: assembly
[error] Not a valid project ID: assembly
[error] Not a valid configuration: assembly
[error] Not a valid key: assembly
[error] assembly
[error]
编辑 3 JK 明白了。必须添加build.sbt
GitHub README 中指定的信息。