Scala 导入apache phoenix的sbt项目时出错

Scala 导入apache phoenix的sbt项目时出错,scala,sbt,Scala,Sbt,我是一个初学者,我试图使用sbt导入phoenix库以读取spark中的hbase表,但我的build.sbt不断给我错误 导入sbt项目时出错: [error] stack trace is suppressed; run 'last update' for the full output [error] stack trace is suppressed; run 'last ssExtractDependencies' for the full output [error] (update

我是一个初学者,我试图使用sbt导入phoenix库以读取spark中的hbase表,但我的build.sbt不断给我错误

导入sbt项目时出错:

[error] stack trace is suppressed; run 'last update' for the full output
[error] stack trace is suppressed; run 'last ssExtractDependencies' for the full output
[error] (update) sbt.librarymanagement.ResolveException: Error downloading org.apache.hbase:hbase-common:${cdh.hbase.version}
[error]   Not found
[error]   Not found
[error]   not found: /Users/johnny/.ivy2/local/org.apache.hbase/hbase-common/${cdh.hbase.version}/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/apache/hbase/hbase-common/${cdh.hbase.version}/hbase-common-${cdh.hbase.version}.pom
[error] Error downloading org.apache.hbase:hbase-hadoop-compat:${cdh.hbase.version}
[error]   Not found
[error]   Not found
[error]   not found: /Users/johnny/.ivy2/local/org.apache.hbase/hbase-hadoop-compat/${cdh.hbase.version}/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/apache/hbase/hbase-hadoop-compat/${cdh.hbase.version}/hbase-hadoop-compat-${cdh.hbase.version}.pom

[error]   not found: https://repo1.maven.org/maven2/org/apache/hadoop/hadoop-common/${cdh.hadoop.version}/hadoop-common-${cdh.hadoop.version}.pom
[error] Error downloading org.apache.hbase:hbase-hadoop2-compat:${cdh.hbase.version}
[error]   Not found
[error]   Not found
[error]   not found: /Users/johnny/.ivy2/local/org.apache.hbase/hbase-hadoop2-compat/${cdh.hbase.version}/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/apache/hbase/hbase-hadoop2-compat/${cdh.hbase.version}/hbase-hadoop2-compat-${cdh.hbase.version}.pom
[error] Error downloading org.apache.hbase:hbase-annotations:${cdh.hbase.version}
[error]   Not found
[error]   Not found
[error]   not found: /Users/johnny/.ivy2/local/org.apache.hbase/hbase-annotations/${cdh.hbase.version}/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/apache/hbase/hbase-annotations/${cdh.hbase.version}/hbase-annotations-${cdh.hbase.version}.pom
[error] Error downloading org.apache.hbase:hbase-protocol:${cdh.hbase.version}
[error]   Not found
[error]   Not found
[error]   not found: /Users/johnny/.ivy2/local/org.apache.hbase/hbase-protocol/${cdh.hbase.version}/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/apache/hbase/hbase-protocol/${cdh.hbase.version}/hbase-protocol-${cdh.hbase.version}.pom
[error] Error downloading org.apache.hbase:hbase-client:${cdh.hbase.version}
[error]   Not found
[error]   Not found
[error]   not found: /Users/johnny/.ivy2/local/org.apache.hbase/hbase-client/${cdh.hbase.version}/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/apache/hbase/hbase-client/${cdh.hbase.version}/hbase-client-${cdh.hbase.version}.pom
[error] Error downloading org.apache.hbase:hbase-server:${cdh.hbase.version}
[error]   Not found
[error]   Not found
[error]   not found: /Users/johnny/.ivy2/local/org.apache.hbase/hbase-server/${cdh.hbase.version}/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/apache/hbase/hbase-server/${cdh.hbase.version}/hbase-server-${cdh.hbase.version}.pom
[error] Error downloading com.cloudera.cdh:cdh-root:5.11.2
[error]   Not found
[error]   Not found
[error]   not found: /Users/johnny/.ivy2/local/com.cloudera.cdh/cdh-root/5.11.2/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/com/cloudera/cdh/cdh-root/5.11.2/cdh-root-5.11.2.pom
[error] Total time: 3 s, completed Sep 27, 2019, 4:54:09 PM
[info] shutting down sbt server)
我的build.sbt是:

name := "SparkHbase"
version := "0.1"
scalaVersion := "2.11.12"
libraryDependencies ++= Seq(
  "org.apache.spark" %% "spark-core" % "2.2.0" % "provided"
  ,"org.apache.spark" %% "spark-sql" % "2.2.0"  % "provided"
  ,"org.apache.spark" %% "spark-hive" % "2.2.0" % "provided"
  ,"org.apache.phoenix" % "phoenix-spark" % "4.13.2-cdh5.11.2"
)
我甚至包括了这个:
resolvers+=“ClouderaRepo”at”https://repository.cloudera.com/content/repositories/releases“


但是仍然有错误。拜托,我做错了什么?

问题是您试图使用非常旧版本的
phoenix spark
。如果您有HBase 1.3,您可以使用版本
4.14.3-HBase-1.3
,请参阅此
build.sbt

name := "SparkHbase"
version := "0.1"
scalaVersion := "2.11.12"

resolvers += "Cloudera" at "https://repository.cloudera.com/content/repositories/releases/"
resolvers += "Cloudera_Artifactory" at "https://repository.cloudera.com/artifactory/cloudera-repos/"
resolvers += Resolver.sonatypeRepo("releases")

libraryDependencies ++= Seq(
  "org.apache.spark" %% "spark-core" % "2.2.0" % "provided"
  ,"org.apache.spark" %% "spark-sql" % "2.2.0"  % "provided"
  ,"org.apache.spark" %% "spark-hive" % "2.2.0" % "provided"
  ,"org.apache.phoenix" % "phoenix-spark" % "4.14.3-HBase-1.3"
)

${cdh.hbase.version}
来自哪里?它出现在日志中