Hadoop 2.2 & HBase 0.96 Maven 依赖总结

由于Hbase 0.94对Hadoop 2.x的支持不是非常好,故直接添加Hbase 0.94的jar依赖可能会导致问题。

     但是直接添加Hbase0.96的依赖,由于官方并没有发布Hbase 0.96的jar包,通过maven编译项目的时候会出现找不到jar包导致编译失败。

     通过网上的资料,得知Hbase 0.94后版本,直接添加Hbase-Client的依赖,通过查询得知需要以下依赖:

 

[html] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1.  <dependency>  
  2.     <groupId>commons-io</groupId>  
  3.     <artifactId>commons-io</artifactId>  
  4.     <version>1.3.2</version>  
  5.  </dependency>  
  6.  <dependency>  
  7.     <groupId>commons-logging</groupId>  
  8.     <artifactId>commons-logging</artifactId>  
  9.     <version>1.1.3</version>  
  10. </dependency>  
  11. <dependency>  
  12.     <groupId>log4j</groupId>  
  13.     <artifactId>log4j</artifactId>  
  14.     <version>1.2.17</version>  
  15. </dependency>  
  16. <dependency>  
  17.     <groupId>org.apache.hbase</groupId>  
  18.     <artifactId>hbase-client</artifactId>  
  19.     <version>0.96.1-hadoop2</version>  
  20. </dependency>  
  21. <dependency>  
  22.     <groupId>com.google.protobuf</groupId>  
  23.     <artifactId>protobuf-java</artifactId>  
  24.     <version>2.5.0</version>  
  25. </dependency>  
  26. <dependency>  
  27.     <groupId>io.netty</groupId>  
  28.     <artifactId>netty</artifactId>  
  29.     <version>3.6.6.Final</version>  
  30. </dependency>  
  31. <dependency>  
  32.     <groupId>org.apache.hbase</groupId>  
  33.     <artifactId>hbase-common</artifactId>  
  34.     <version>0.96.1-hadoop2</version>  
  35. </dependency>  
  36. <dependency>  
  37.     <groupId>org.apache.hbase</groupId>  
  38.     <artifactId>hbase-protocol</artifactId>  
  39.     <version>0.96.1-hadoop2</version>  
  40. </dependency>  
  41. <dependency>  
  42.     <groupId>org.apache.zookeeper</groupId>  
  43.     <artifactId>zookeeper</artifactId>  
  44.     <version>3.4.5</version>  
  45. </dependency>  
  46. <dependency>  
  47.     <groupId>org.cloudera.htrace</groupId>  
  48.     <artifactId>htrace-core</artifactId>  
  49.     <version>2.01</version>  
  50. </dependency>  
  51. <dependency>  
  52.     <groupId>org.codehaus.jackson</groupId>  
  53.     <artifactId>jackson-mapper-asl</artifactId>  
  54.     <version>1.9.13</version>  
  55. </dependency>  
  56. <dependency>  
  57.     <groupId>org.codehaus.jackson</groupId>  
  58.     <artifactId>jackson-core-asl</artifactId>  
  59.     <version>1.9.13</version>  
  60. </dependency>  
  61. <dependency>  
  62.     <groupId>org.codehaus.jackson</groupId>  
  63.     <artifactId>jackson-jaxrs</artifactId>  
  64.     <version>1.9.13</version>  
  65. </dependency>  
  66. <dependency>  
  67.     <groupId>org.codehaus.jackson</groupId>  
  68.     <artifactId>jackson-xc</artifactId>  
  69.     <version>1.9.13</version>  
  70. </dependency>  
  71. <dependency>  
  72.     <groupId>org.slf4j</groupId>  
  73.     <artifactId>slf4j-api</artifactId>  
  74.     <version>1.6.4</version>  
  75. </dependency>  
  76. <dependency>  
  77.     <groupId>org.slf4j</groupId>  
  78.     <artifactId>slf4j-log4j12</artifactId>  
  79.     <version>1.6.4</version>  
  80. </dependency>  

 

    若要使用org.apache.hadoop.hbase.mapreduce的API,需要加上:

                <dependency> 

                        <groupId>org.apache.hbase</groupId> 

                       <artifactId>hbase-server</artifactId>

                       <version>0.96.1-hadoop2</version> 

               </dependency>

 

     最后,把Hadoop的依赖也贴上来,以防自己忘记:

           <!--hdoop-->
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-client</artifactId>
            <version>2.3.0</version>
        </dependency>
        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
            <version>1.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-auth</artifactId>
            <version>2.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
            <version>2.3.0</version>
        </dependency>

posted @ 2016-08-20 12:35  哼哼哈哈二将  阅读(607)  评论(0编辑  收藏  举报