maven 错误 Downloading httprepo.maven.apache.orgmaven2 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 即可

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

<mirror>
      <id>nexus-aliyun</id>
      <mirrorOf>central</mirrorOf>
      <name>Nexus aliyun</name>             
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值