hbasetestinguility是否在小型集群中工作?

hbasetestinguility是否在小型集群中工作?,hbase,hbasetestingutility,Hbase,Hbasetestingutility,我有一个简单的单元测试,我想针对HBaseTestingUtilityMiniCluster运行。缺少使用hbasetestinguility运行测试所需的可传递依赖项。我一直在跟踪NoClassDefFoundErrors,并在其中一个jar文件的打包过程中遇到了一些错误。以下是错误: java.lang.NoClassDefFoundError:org/apache/hadoop/hbase/test/MetricAssertHelper 位于org.apache.hadoop.hbase.

我有一个简单的单元测试,我想针对
HBaseTestingUtility
MiniCluster运行。缺少使用
hbasetestinguility
运行测试所需的可传递依赖项。我一直在跟踪NoClassDefFoundErrors,并在其中一个jar文件的打包过程中遇到了一些错误。以下是错误:

java.lang.NoClassDefFoundError:org/apache/hadoop/hbase/test/MetricAssertHelper
位于org.apache.hadoop.hbase.MiniHBaseCluster.(MiniHBaseCluster.java:91)

在项目的.jar文件中搜索MetricAssertHelper时,我在META-INF/services目录下找到了该文件:

jar-tvf org/apache/hbase/hbase-hadoop2-compat/1.0.0/hbase-hadoop2-compat-1.0.0-tests.jar | grep MetricAssertHelper
53 Sat Feb 14 19:43:40 MST 2015 META-INF/services/org.apache.hadoop.hbase.test.MetricAssertHelper
1337年2月14日星期六19:43:40 MST 2015 org/apache/hadoop/hbase/test/MetricAssertHelperPerImpl$MockMetricsBuilder.class
3743 Sat Feb 14 19:43:40 MST 2015 org/apache/hadoop/hbase/test/MetricAssertHelperPerImpl$MockRecordBuilder.class
6689年2月14日星期六19:43:40 MST 2015 org/apache/hadoop/hbase/test/MetricAssertHelperPerimpl.class

但是,这不是.class文件。我想知道.jar文件中是否缺少
MetricAssertHelper.class
文件,因为那里有一个“MetricAssertHelpPerImpl.class文件”

这是我的代码和mvn依赖项。该错误发生在
hbasetestinguility.startMiniCluster()调用上

    private static HBaseTestingUtility utility; 

@Before
public void setUp() throws Exception {
    utility = new HBaseTestingUtility();
    utility.startMiniCluster();
}


    <dependencies>

    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-minicluster</artifactId>
        <version>2.5.1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-server</artifactId>
        <version>1.0.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-server</artifactId>
        <version>1.0.0</version>
        <type>test-jar</type>
    </dependency>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-hadoop2-compat</artifactId>
        <version>1.0.0</version>
        <scope>test</scope>
        <type>test-jar</type>
    </dependency>

</dependencies>
专用静态HBaseTestingUtility实用程序;
@以前
public void setUp()引发异常{
实用工具=新的HBaseTestingUtility();
utility.startMiniCluster();
}
org.apache.hadoop
hadoop小型集群
2.5.1
org.apache.hbase
hbase服务器
1.0.0
测试
org.apache.hbase
hbase服务器
1.0.0
试验罐
org.apache.hbase
hbase-hadoop2-compat
1.0.0
测试
试验罐

问题是除了
hbase-hadoop2-compat
之外,我还需要一个对
hbase-hadoopcompat
的依赖项。以下是使用HBaseTestingUtility MiniCluster运行JUnit测试所需的依赖项的完整列表

    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-minicluster</artifactId>
        <version>2.5.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-server</artifactId>
        <version>1.0.0</version>
        <type>test-jar</type>
    </dependency>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-hadoop-compat</artifactId>
        <version>1.0.0</version>
        <scope>test</scope>
        <type>test-jar</type>
    </dependency>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-hadoop2-compat</artifactId>
        <version>1.0.0</version>
        <scope>test</scope>
        <type>test-jar</type>
    </dependency>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-server</artifactId>
        <version>1.0.0</version>
        <scope>test</scope>
    </dependency>

org.apache.hadoop
hadoop小型集群
2.5.1
org.apache.hbase
hbase服务器
1.0.0
试验罐
org.apache.hbase
hbase hadoop compat
1.0.0
测试
试验罐
org.apache.hbase
hbase-hadoop2-compat
1.0.0
测试
试验罐
org.apache.hbase
hbase服务器
1.0.0
测试

问题是除了
hbase-hadoop2-compat
之外,我还需要一个对
hbase-hadoopcompat
的依赖项。以下是使用HBaseTestingUtility MiniCluster运行JUnit测试所需的依赖项的完整列表

    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-minicluster</artifactId>
        <version>2.5.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-server</artifactId>
        <version>1.0.0</version>
        <type>test-jar</type>
    </dependency>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-hadoop-compat</artifactId>
        <version>1.0.0</version>
        <scope>test</scope>
        <type>test-jar</type>
    </dependency>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-hadoop2-compat</artifactId>
        <version>1.0.0</version>
        <scope>test</scope>
        <type>test-jar</type>
    </dependency>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-server</artifactId>
        <version>1.0.0</version>
        <scope>test</scope>
    </dependency>

org.apache.hadoop
hadoop小型集群
2.5.1
org.apache.hbase
hbase服务器
1.0.0
试验罐
org.apache.hbase
hbase hadoop compat
1.0.0
测试
试验罐
org.apache.hbase
hbase-hadoop2-compat
1.0.0
测试
试验罐
org.apache.hbase
hbase服务器
1.0.0
测试

所有依赖项都应该有测试为什么不添加以下内容:org.apache.hbase:hbase testing util:1.1.1?所有依赖项都应该有测试为什么不添加以下内容:org.apache.hbase:hbase testing util:1.1.1?