maven build failure 报错解决

1. 错误信息:

在cmd内查看Maven能不能正常使用。
输入命令:mvn help:system
build_failure

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  23.239 s
[INFO] Finished at: 2019-04-11T19:12:21+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-help-plugin:3.1.1:system (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-help-plugin:3.1.1:system failed: Plugin org.apache.maven.plugins:maven-help-plugin:3.1.1 or one of its dependencies could not be resolved: Could not transfer artifact org.codehaus.plexus:plexus-component-annotations:jar:1.7.1 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.196.215] failed: Connection timed out: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

   
   
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
2. 解决方案

最后经过排查,发现用的默认国外服务器的问题,改为aliyun的后,问题解决。
方法如下:
修改Maven的settings.xml文件,在mirrors标签内添加:

	<mirror>
  	    <id>nexus-aliyun</id>
  		<mirrorOf>*</mirrorOf>
  		<name>Nexus aliyun</name>
  		<url>http://maven.aliyun.com/nexus/content/groups/public</url>
  	</mirror>

   
   
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

最后终于看到了SUCCESS。
这样构建JavaWeb项目也没了问题。
build_success

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值