【甘道夫】CDH5.2的Maven依赖

之前一直结合Maven开发Hadoop2.2.0的程序。环境换成CDH5.2后报错,发现是Maven依赖库的问题。
之前一直使用
查找maven依赖。但这类站点仅仅能查到通用的maven依赖,没有包括CDH依赖。还好Cloudera提供了CDH的依赖:

简言之,往pom文件增加下面两部分内容就可以:
1.指向cloudera的库
    <repositories>
        <repository>
            <id>cloudera</id>
            <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
        </repository>
    </repositories>  

2.CDH相关依赖,比方
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
            <version>2.5.0-cdh5.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-hdfs</artifactId>
            <version>2.5.0-cdh5.2.0</version>
        </dependency>
        
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-maven-plugins</artifactId>
            <version>2.5.0-cdh5.2.0</version>
        </dependency>
        
        <dependency>
            <groupId>org.apache.hbase</groupId>
            <artifactId>hbase-client</artifactId>
            <version>0.98.6-cdh5.2.0</version>
        </dependency>  

很多其它的CDH依赖请查阅

posted @ 2016-04-21 09:14  mengfanrong  阅读(1743)  评论(0编辑  收藏  举报