创建一个示例Scala项目结构(在我的基于OS X Mavericks的计算机上),如下所示:
在sample_project目录中:
src
main
java
scala
Hello.scala
resources
test
java
scala
resources
build.sbt
Hello.scala:
object Hello {
def main(args: Array[String]) = println("Hello!")
}
build.sbt:
name := "hello"
version := "1.0"
scalaVersion := "2.11.1"
将build.properties放在sample_project / project下:
sbt.version=0.13.5
当我尝试使用" sbt"根文件夹中的命令:
/sample_project $ sbt
Getting org.scala-tools.sbt sbt_2.8.1 0.13.5 ...
:: problems summary ::
:::: WARNINGS
module not found: org.scala-tools.sbt#sbt_2.8.1;0.13.5
==== local: tried
.ivy2/local/org.scala-tools.sbt/sbt_2.8.1/0.13.5/ivys/ivy.xml
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.13.5!sbt_2.8.1.jar:
.ivy2/local/org.scala-tools.sbt/sbt_2.8.1/0.13.5/jars/sbt_2.8.1.jar
==== Maven2 Local: tried
file://.m2/repository/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.pom
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.13.5!sbt_2.8.1.jar:
file://.m2/repository/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.jar
==== typesafe-ivy-releases: tried
http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt_2.8.1/0.13.5/ivys/ivy.xml
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.13.5!sbt_2.8.1.jar:
http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt_2.8.1/0.13.5/jars/sbt_2.8.1.jar
==== Maven Central: tried
http://repo1.maven.org/maven2/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.pom
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.13.5!sbt_2.8.1.jar:
http://repo1.maven.org/maven2/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.jar
==== Scala-Tools Maven2 Repository: tried
http://scala-tools.org/repo-releases/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.pom
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.13.5!sbt_2.8.1.jar:
http://scala-tools.org/repo-releases/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.jar
==== Scala-Tools Maven2 Snapshots Repository: tried
http://scala-tools.org/repo-snapshots/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.pom
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.13.5!sbt_2.8.1.jar:
http://scala-tools.org/repo-snapshots/org/scala-tools/sbt/sbt_2.8.1/0.13.5/sbt_2.8.1-0.13.5.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-tools.sbt#sbt_2.8.1;0.13.5: not found
::::::::::::::::::::::::::::::::::::::::::::::
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-tools.sbt#sbt_2.8.1;0.13.5: not found
Error during sbt execution: Error retrieving required libraries
(see sample_project/project/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.5
答案 0 :(得分:0)
这看起来像sbt版本不匹配。在project
下创建一个sample_project
目录,在其中创建一个名为build.properties
的文件,其中包含以下内容:
sbt.version=0.13.5
答案 1 :(得分:0)