1

我正在尝试基于 Hortonworks 教程创建一个新的 Spark 应用程序。但是当我尝试导入必要的模块时,build.sbt 不断抛出以下错误。

我安装了 SCALA - 2.11.4 和 SBT 0.13。有什么帮助吗??

Error:Error while importing SBT project:<br/>...<br/><pre>[warn]    ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]      org.scala-lang:scala-library:2.11.4 ((sbt.Classpaths) Defaults.scala#L1340)
[warn]        +- sparktutorialscala:sparktutorialscala_2.11:1.0
[warn]      org.apache.spark:spark-core_2.11:2.1.0 (C:\Users\USERNAME\IdeaProjects\HelloWorld\build.sbt#L7-13)
[warn]        +- sparktutorialscala:sparktutorialscala_2.11:1.0
[warn]      org.scala-lang:scala-compiler:2.11.4
[warn]        +- sparktutorialscala:sparktutorialscala_2.11:1.0
[trace] Stack trace suppressed: run 'last *:ssExtractDependencies' for the full output.
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[error] (*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.11.4: not found
[error] unresolved dependency: org.apache.spark#spark-core_2.11;2.1.0: not found
[error] unresolved dependency: org.scala-lang#scala-compiler;2.11.4: not found
[error] (*:update) sbt.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.11.4: not found
[error] unresolved dependency: org.apache.spark#spark-core_2.11;2.1.0: not found
[error] unresolved dependency: org.scala-lang#scala-compiler;2.11.4: not found
[error] Total time: 66 s, completed 17-Oct-2017 10:49:23
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true</pre><br/>See complete 

构建.sbt

name := "sparkTutorialScala"

version := "1.0"

scalaVersion := "2.11.4"

libraryDependencies ++= {
  val sparkVer = "2.1.0"
  Seq(
    "org.apache.spark" %% "spark-core" % sparkVer % "provided" withSources()
  )
}

更新的错误消息:

  [error] unresolved dependency: org.apache.spark#spark-core_2.11;2.2.0: public: unable to get resource for org/apache/spark#spark-core_2.11;2.2.0: res=https://repo1.maven.org/maven2/org/apache/spark/spark-core_2.11/2.2.0/spark-core_2.11-2.2.0.pom: java.net.ConnectException: Failed to connect to repo1.maven.org/151.101.60.209:443
[error] unresolved dependency: org.scala-lang#scala-compiler;2.11.8: public: unable to get resource for org/scala-lang#scala-compiler;2.11.8: res=https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.8/scala-compiler-2.11.8.pom: java.net.ConnectException: Failed to connect to repo1.maven.org/151.101.60.209:443
[error] (*:ssExtractDependencies) sbt.librarymanagement.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.11.8: public: unable to get resource for org/scala-lang#scala-library;2.11.8: res=https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.8/scala-library-2.11.8.pom: java.net.ConnectException: Failed to connect to repo1.maven.org/151.101.60.209:443
[error] unresolved dependency: org.apache.spark#spark-core_2.11;2.2.0: public: unable to get resource for org/apache/spark#spark-core_2.11;2.2.0: res=https://repo1.maven.org/maven2/org/apache/spark/spark-core_2.11/2.2.0/spark-core_2.11-2.2.0.pom: java.net.ConnectException: Failed to connect to repo1.maven.org/151.101.60.209:443
[error] unresolved dependency: org.scala-lang#scala-compiler;2.11.8: public: unable to get resource for org/scala-lang#scala-compiler;2.11.8: res=https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.8/scala-compiler-2.11.8.pom: java.net.ConnectException: Failed to connect to repo1.maven.org/151.101.60.209:443
[error] Total time: 9 s, completed 19-Oct-2017 15:11:47
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true</pre><br/>See complete log in <a href="file:/C:/Users/
4

1 回答 1

0

好吧,SBT 1.0 与我使用的 IDEAJ 插件或 spark 版本不兼容。安装 SBT 0.13 而不是最新版本解决了这个问题。

于 2017-10-19T16:12:42.500 回答