任何人都成功跟随 http://www.scala-sbt.org/0.13/docs/Command-Line-Applications.html 使用最新的sbt 0.13.7?
对于0.12.0,我得到未解决的依赖“org.scala-sbt#command; 0.12.0:not found”。 尝试命令版本0.13.7会在initialGlobalLogging周围的Main.scala文件中出现编译错误:
[error] Unspecified value parameter console.
[error] GlobalLogging.initial(MainLogging.globalDefault _, File.crea
teTempFile("hello", "log") )
[error] GlobalLogging.initial(MainLogging.globalDefault _, File.crea
teTempFile("hello", "log") )
谢谢
答案 0 :(得分:2)
0.13.7似乎更新了GlobalLogging.initial()的参数类型和数量。 (http://www.scala-sbt.org/0.13.7/api/#sbt.GlobalLogging $)
尝试更改Main.scala中的最后两行:
这
/** Configures logging to log to a temporary backing file as well as to the console.
* An application would need to do more here to customize the logging level and
* provide access to the backing file (like sbt's last command and logLevel setting).*/
def initialGlobalLogging: GlobalLogging =
GlobalLogging.initial(MainLogging.globalDefault _, File.createTempFile("hello", "log"))
到
val consoleOut = ConsoleOut.systemOut
def initialGlobalLogging: GlobalLogging =
GlobalLogging.initial(MainLogging.globalDefault(consoleOut).apply, java.io.File.createTempFile("hello", "log"), consoleOut )
答案 1 :(得分:0)
是的,我得到了同样的错误。但是,通过将文件重命名为“project / build.properties”并通过-Dsbt.repository.config
指定文件来解决错误:
~/Documents/spark/hello $ sbt -Dsbt.repository.config=./project/build.properties
[info] Loading project definition from /Users/suztomo/Documents/spark/hello/project
[warn] Multiple resolvers having different access mechanism configured with same name 'typesafe-ivy-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).
[info] Updating {file:/Users/suztomo/Documents/spark/hello/project/}hello-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-library;2.10.4!scala-library.jar (6413ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.7/jars/sbt.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#sbt;0.13.7!sbt.jar (410ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.13.7/jars/main.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#main;0.13.7!main.jar (1955ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.7/jars/compiler-interface-src.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.7!compiler-interface-src.jar (197ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.7/jars/compiler-interface-bin.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.7!compiler-interface-bin.jar (304ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_8_2/0.13.7/jars/compiler-interface-bin.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#precompiled-2_8_2;0.13.7!compiler-interface-bin.jar (383ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_9_2/0.13.7/jars/compiler-interface-bin.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#precompiled-2_9_2;0.13.7!compiler-interface-bin.jar (438ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_9_3/0.13.7/jars/compiler-interface-bin.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#precompiled-2_9_3;0.13.7!compiler-interface-bin.jar (556ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/actions/0.13.7/jars/actions.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#actions;0.13.7!actions.jar (604ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main-settings/0.13.7/jars/main-settings.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#main-settings;0.13.7!main-settings.jar (478ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/interface/0.13.7/jars/interface.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#interface;0.13.7!interface.jar (190ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/io/0.13.7/jars/io.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#io;0.13.7!io.jar (364ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/ivy/0.13.7/jars/ivy.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#ivy;0.13.7!ivy.jar (699ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/launcher-interface/0.13.7/jars/launcher-interface.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#launcher-interface;0.13.7!launcher-interface.jar (187ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/logging/0.13.7/jars/logging.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#logging;0.13.7!logging.jar (245ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/logic/0.13.7/jars/logic.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#logic;0.13.7!logic.jar (189ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/process/0.13.7/jars/process.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#process;0.13.7!process.jar (247ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/run/0.13.7/jars/run.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#run;0.13.7!run.jar (253ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/command/0.13.7/jars/command.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#command;0.13.7!command.jar (297ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/classpath/0.13.7/jars/classpath.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#classpath;0.13.7!classpath.jar (285ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/completion/0.13.7/jars/completion.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#completion;0.13.7!completion.jar (634ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/api/0.13.7/jars/api.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#api;0.13.7!api.jar (359ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-integration/0.13.7/jars/compiler-integration.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#compiler-integration;0.13.7!compiler-integration.jar (247ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-ivy-integration/0.13.7/jars/compiler-ivy-integration.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#compiler-ivy-integration;0.13.7!compiler-ivy-integration.jar (186ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/relation/0.13.7/jars/relation.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#relation;0.13.7!relation.jar (189ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/task-system/0.13.7/jars/task-system.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#task-system;0.13.7!task-system.jar (322ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/tasks/0.13.7/jars/tasks.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#tasks;0.13.7!tasks.jar (465ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/tracking/0.13.7/jars/tracking.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#tracking;0.13.7!tracking.jar (270ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/testing/0.13.7/jars/testing.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#testing;0.13.7!testing.jar (241ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.10.4/scala-compiler-2.10.4.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-compiler;2.10.4!scala-compiler.jar (12424ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.10.4/scala-reflect-2.10.4.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.10.4!scala-reflect.jar (3486ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/control/0.13.7/jars/control.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#control;0.13.7!control.jar (268ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/collections/0.13.7/jars/collections.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#collections;0.13.7!collections.jar (418ms)
[info] downloading https://repo1.maven.org/maven2/jline/jline/2.11/jline-2.11.jar ...
[info] [SUCCESSFUL ] jline#jline;2.11!jline.jar (352ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/incremental-compiler/0.13.7/jars/incremental-compiler.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#incremental-compiler;0.13.7!incremental-compiler.jar (622ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compile/0.13.7/jars/compile.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#compile;0.13.7!compile.jar (236ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/persist/0.13.7/jars/persist.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#persist;0.13.7!persist.jar (264ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/classfile/0.13.7/jars/classfile.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#classfile;0.13.7!classfile.jar (210ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbinary/sbinary_2.10/0.4.2/jars/sbinary_2.10.jar ...
[info] [SUCCESSFUL ] org.scala-tools.sbinary#sbinary_2.10;0.4.2!sbinary_2.10.jar (260ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/cross/0.13.7/jars/cross.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#cross;0.13.7!cross.jar (190ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt.ivy/ivy/2.3.0-sbt-fccfbd44c9f64523b61398a0155784dcbaeae28f/jars/ivy.jar ...
[info] [SUCCESSFUL ] org.scala-sbt.ivy#ivy;2.3.0-sbt-fccfbd44c9f64523b61398a0155784dcbaeae28f!ivy.jar (1006ms)
[info] downloading https://repo1.maven.org/maven2/com/jcraft/jsch/0.1.46/jsch-0.1.46.jar ...
[info] [SUCCESSFUL ] com.jcraft#jsch;0.1.46!jsch.jar (322ms)
[info] downloading https://repo1.maven.org/maven2/org/json4s/json4s-native_2.10/3.2.10/json4s-native_2.10-3.2.10.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-native_2.10;3.2.10!json4s-native_2.10.jar (194ms)
[info] downloading https://repo1.maven.org/maven2/org/spire-math/jawn-parser_2.10/0.6.0/jawn-parser_2.10-0.6.0.jar ...
[info] [SUCCESSFUL ] org.spire-math#jawn-parser_2.10;0.6.0!jawn-parser_2.10.jar (179ms)
[info] downloading https://repo1.maven.org/maven2/org/spire-math/json4s-support_2.10/0.6.0/json4s-support_2.10-0.6.0.jar ...
[info] [SUCCESSFUL ] org.spire-math#json4s-support_2.10;0.6.0!json4s-support_2.10.jar (155ms)
[info] downloading https://repo1.maven.org/maven2/org/json4s/json4s-core_2.10/3.2.10/json4s-core_2.10-3.2.10.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-core_2.10;3.2.10!json4s-core_2.10.jar (664ms)
[info] downloading https://repo1.maven.org/maven2/org/json4s/json4s-ast_2.10/3.2.10/json4s-ast_2.10-3.2.10.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-ast_2.10;3.2.10!json4s-ast_2.10.jar (214ms)
[info] downloading https://repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer/2.6/paranamer-2.6.jar ...
[info] [SUCCESSFUL ] com.thoughtworks.paranamer#paranamer;2.6!paranamer.jar (157ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scalap/2.10.0/scalap-2.10.0.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scalap;2.10.0!scalap.jar (517ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/cache/0.13.7/jars/cache.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#cache;0.13.7!cache.jar (391ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/test-agent/0.13.7/jars/test-agent.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#test-agent;0.13.7!test-agent.jar (311ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0/test-interface-1.0.jar ...
[error] Server access Error: Operation timed out url=https://repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0/test-interface-1.0.jar.sha1
[info] [SUCCESSFUL ] org.scala-sbt#test-interface;1.0!test-interface.jar (11439ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/apply-macro/0.13.7/jars/apply-macro.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#apply-macro;0.13.7!apply-macro.jar (498ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/jline/2.10.4/jline-2.10.4.jar ...
[info] [SUCCESSFUL ] org.scala-lang#jline;2.10.4!jline.jar (424ms)
[info] downloading https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.4/jansi-1.4.jar ...
[info] [SUCCESSFUL ] org.fusesource.jansi#jansi;1.4!jansi.jar (220ms)
[info] Done updating.
[info] Set current project to hello (in build file:/Users/suztomo/Documents/spark/hello/)
> compile
[info] Updating {file:/Users/suztomo/Documents/spark/hello/}hello...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/command/0.12.0/jars/command.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#command;0.12.0!command.jar (304ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/interface/0.12.0/jars/interface.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#interface;0.12.0!interface.jar (200ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/io/0.12.0/jars/io.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#io;0.12.0!io.jar (321ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/launcher-interface/0.12.0/jars/launcher-interface.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#launcher-interface;0.12.0!launcher-interface.jar (181ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/logging/0.12.0/jars/logging.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#logging;0.12.0!logging.jar (211ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/completion/0.12.0/jars/completion.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#completion;0.12.0!completion.jar (343ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/classpath/0.12.0/jars/classpath.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#classpath;0.12.0!classpath.jar (197ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/control/0.12.0/jars/control.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#control;0.12.0!control.jar (183ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/process/0.12.0/jars/process.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#process;0.12.0!process.jar (239ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/collections/0.12.0/jars/collections.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#collections;0.12.0!collections.jar (604ms)
[info] downloading https://repo1.maven.org/maven2/jline/jline/1.0/jline-1.0.jar ...
[info] [SUCCESSFUL ] jline#jline;1.0!jline.jar (251ms)
[info] Done updating.
[success] Total time: 7 s, completed 2014/11/27 15:36:41
有关详细说明,请参阅(sbt configuration documentation)
分享我的环境以与您的环境进行比较:
~/Documents/spark/hello $ which java
/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java
~/Documents/spark/hello $ which sbt
/usr/local/bin/sbt
~/Documents/spark/hello $ brew info sbt
sbt: stable 0.13.7 (bottled)
...