maven 错误 Downloading: http://repo.maven.apache.org/maven2/ maven 更换阿里云mirror

错误信息:


root@node1:/usr/local/hadoop-2.7.2-src# mvn package -Pdist,native,docs -DskipTests -Dtar
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/felix/maven-bundle-plugin/2.4.0/maven-bundle-plugin-2.4.0.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ line 388, column 19
[ERROR] Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:2.4.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.felix:maven-bundle-plugin 2.4.0 @
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]  
[ERROR]   The project org.apache.hadoop:hadoop-main:2.5.2 (/usr/local/hadoop-2.5.2-src/pom.xml) has 1 error
[ERROR]     Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:2.4.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.felix:maven-bundle-plugin 2.4.0: Could not transfer artifact org.apache.felix:maven-bundle-plugin:pom:2.4.0 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name or service not known: Unknown host repo.maven.apache.org: Name or service not known -> [Help 2]
 

解决办法:

maven 默认下载源在国外,国内被墙了,更换 ${MAVEN_HOME}/conf/settings.xml 文件中的 mirror 即可

在文件中的 中添加如下内容即可


      nexus-aliyun
      central
      Nexus aliyun             
      http://maven.aliyun.com/nexus/content/groups/public/

 

你可能感兴趣的:(大数据开发,maven,apache,hadoop)