cdh版本hadoop的Maven之pom.xml文件配置

通用版本Hadoop的pom.xml文件配置只需要参考网址https://mvnrepository.com/artifact/org.apache.hadoop

 

例如2.2.0版本Hadoop配置为:



    org.apache.hadoop
    hadoop-common
    2.2.0

上述网址没有cdh版本Hadoop的pom.xml文件配置信息

而cdh版本的Hadoop需要参考https://www.cloudera.com/documentation/enterprise/release-notes/topics/cdh_vd_cdh5_maven_repo.html

例如我使用hadoop-2.6.0-cdh5.9.3 配置信息为:


    
       org.apache.hadoop
       hadoop-common
       2.6.0-cdh5.9.3
    
    
    
       org.apache.hadoop
       hadoop-mapreduce-client-core
       2.6.0-cdh5.9.3
    
 

此时出现Missing artifact org.apache.hadoop:hadoop-common:jar:2.6.0-cdh5.9.3 报错,这是因为pom.xml没有配置下载环境

需要加上下载环境


     
       cloudera
       https://repository.cloudera.com/artifactory/cloudera-repos/
     
  

pom.xml文件为




  4.0.0
  cn.itcast.hadoop.mr
  datacount
  0.0.1-SNAPSHOT

  
     
       cloudera
       https://repository.cloudera.com/artifactory/cloudera-repos/
     
  

  
    
       org.apache.hadoop
       hadoop-common
       2.6.0-cdh5.9.3
    
    
    
       org.apache.hadoop
       hadoop-mapreduce-client-core
       2.6.0-cdh5.9.3
    
  
  


 

你可能感兴趣的:(cdh版本hadoop的Maven之pom.xml文件配置)