如何在sbt中导入hbase testing util?

ryevplcw  于 2021-06-09  发布在  Hbase
关注(0)|答案(1)|浏览(489)

以下是我的项目的依赖关系:

libraryDependencies ++= Seq(
  "org.jpmml" % "pmml-evaluator" % "1.2.1",
  "org.apache.kafka" %% "kafka" % "0.8.2.1",
  "org.apache.spark" %% "spark-core" % "1.2.0",
  "org.apache.spark" %% "spark-streaming" % "1.2.0",
  "org.apache.spark" %% "spark-streaming-kafka" % "1.2.0",
  "org.apache.hbase" % "hbase-common" % "0.98.6-cdh5.3.1",
  "org.apache.hbase" % "hbase-client" % "0.98.6-cdh5.3.1",
  "org.apache.hbase" % "hbase-server" % "0.98.6-cdh5.3.1",
  "org.apache.hbase" % "hbase-testing-util" % "0.98.6-cdh5.3.1" % "test",
  "org.apache.hadoop" % "hadoop-hdfs" % "0.98.6-cdh5.3.1",
  "org.apache.hadoop" % "hadoop-common" % "0.98.6-cdh5.3.1",
  "org.scalatest" %% "scalatest" % "2.2.4" % "test",
  "eu.unicredit" %% "hbase-rdd" % "0.5.3"
)

我需要上课 HBaseTestingUtility 对hbase进行单元测试。问题是sbt0.13.8中可能有一个bug无法导入hbase testing util pom文件中的依赖项。sbt0.13.6中有一个相关bug的参考,但应该已经解决了。
如果你想检查文件,这就是我正在处理的回购:https://repository.cloudera.com/cloudera/libs-release/org/apache/hbase/hbase-testing-util/0.98.6-cdh5.3.1/
有办法解决这个问题吗?有什么解决方法可以使用这个类吗?我需要手动导入吗?

o0lyfsai

o0lyfsai1#

minihbasecluster在hbase服务器的测试包中,因此需要手动添加“tests”分类器,如:

libraryDependencies ++= Seq (
  "org.apache.hbase" % "hbase-testing-util" % hbaseVersion,
  "org.apache.hbase" % "hbase-server" % hbaseVersion,
  "org.apache.hbase" % "hbase-server" % hbaseVersion classifier "tests"
)

相关问题