hoyong

导航

Idea创建Maven项目时出现Failed to execute goal org.apache.maven.plugins

#问题产生原因
报错信息中有这句话: Connection to http://repo.maven.apache.org refused.说明电脑访问不了maven repository

#解决
maven默认仓库在国外,下载速度慢,所以需要在setting.xml文件中配置镜像.这里用的是阿里云镜像


步骤: 找到maven安装目录(D:\apache-maven-3.5.2\conf\setting.xml)使用的setting文件 — 找到< mirrors> < /mirrors>选项,在里面添加以下代码

<mirror>
  <id>alimaven</id>
  <name>aliyun maven</name>
  <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  <mirrorOf>central</mirrorOf>        
</mirror>

保存后,重新创建项目就搞定.

posted on 2020-03-24 21:53  hoyong  阅读(1105)  评论(0)    收藏  举报