gpt4 book ai didi

unit-testing - Clojure/HBase : How to Import HBaseTestingUtility in v0. 94.6.1

转载 作者:行者123 更新时间:2023-12-04 04:51:14 25 4
gpt4 key购买 nike

在 Clojure 中,如果我想使用 hbase 测试实用程序启动测试集群,我必须使用以下内容注释我的依赖项:

[org.apache.hbase/hbase "0.92.2" :classifier "tests" :scope "test"]

首先,我不知道这是什么意思。根据 leiningens 示例 project.clj
;; Dependencies are listed as [group-id/name version]; in addition
;; to keywords supported by Pomegranate, you can use :native-prefix
;; to specify a prefix. This prefix is used to extract natives in
;; jars that don't adhere to the default "<os>/<arch>/" layout that
;; Leiningen expects.

问题1:这是什么意思?

问题2:如果我升级版本:
[org.apache.hbase/hbase "0.94.6.1" :classifier "tests" :scope "test"]

然后我收到一个 ClassNotFoundException
Exception in thread "main" java.lang.ClassNotFoundException: org.apache.hadoop.hbase.HBaseConfiguration

这是怎么回事,我该如何解决?

最佳答案

添加到依赖项声明的任何键/值对都用作 clojure pomegranate 库的参数

识别的 key 列在此处的源中:in the source to pomagranate (以供将来引用,该链接指向功能 resolve-artifacts*)

the maven pom docs may also be helpful

:scope 描述了使用依赖项的条件,因此 :scope "test"似乎表明该依赖项仅在测试时被拉入

:classifier 似乎表明了一个额外的元素来区分版本

我推测较新的 hbase 版本的依赖项解析可能有一个配置不当的 pom,它没有正确声明其依赖项。尝试查找 org.apache.hadoop.hbase.HBaseConfiguration 的信息并手动要求包。

关于unit-testing - Clojure/HBase : How to Import HBaseTestingUtility in v0. 94.6.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17410849/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com