hadoop单元调试:MRunit(maven配置pom.xml)

hadoop进行单元测试时报错:
Found interface org.apache.hadoop.mapreduce.TaskInputOutputContext, but class was expected
我的是因为使用maven的同时自己手动又导入了hadoop2.7.1的所有jar包,使得这里的jar包maven的pom.xml中配置的hadoop的jar包冲突了。
我的解决办法是把hadoop中的jar包remove掉,问题解决了!
以下是我的pom.xml

<dependencies>

<dependency>
           <groupId>org.apache.hadoopgroupId>
           <artifactId>hadoop-coreartifactId>
          <version>0.20.2version>
         dependency>
  
<dependency>
    <groupId>junitgroupId>
    <artifactId>junitartifactId>
    <version>4.12version>
    <scope>testscope>
dependency>

<dependency>
    <groupId>org.hamcrestgroupId>
    <artifactId>hamcrest-allartifactId>
    <version>1.3version>
    <scope>testscope>
dependency>

<dependency>
    <groupId>org.apache.mrunitgroupId>
    <artifactId>mrunitartifactId>
    <version>0.8.0-incubatingversion>
dependency>


<dependency>
    <groupId>com.sun.jerseygroupId>
    <artifactId>jersey-coreartifactId>
    <version>1.19.1version>
dependency>
dependencies>

你可能感兴趣的:(hadoop)