大忙人系列_解决maven插件下载异常

异常发现

我们创建的项目为maven项目,我们需要执行命令:maven clean,出现的:“Plugin org.apache.maven.plugins:maven-clean-plugin:3.0.0 or one of its dependencies could not be resolved”异常

异常展示

[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:3.0.0 or one of its dependencies could not be resolved: Cannot access nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public/) in offline mode and the artifact org.apache.maven.plugins:maven-clean-plugin:jar:3.0.0 has not been downloaded from it before. -> [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

核心在第一行意思大意如下图

大忙人系列_解决maven插件下载异常_第1张图片

问题原因

maven缺少相关的插件依赖,需要联网下载相关的插件。

解决方法

1、配置的阿里云私服配置异常(上述提示可以看出,配置地址正确)。

如果阿里云未配置,可以在maven的setting.xml中配置如下


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

2、离线无法下载。

这也是本文所遇到的问题是导致无法下载。一般会有两个原因,首先要确保自己本地是联网(如果本地都是离线那没法解决),其次就是我们在maven的setting.xml中将工作环境设置为了离线模式

解决:找到本地的maven的setting.xml文件,打开。找到“  true”修改为: “false”即可。

  
  true
  
  
  false

大忙人系列_解决maven插件下载异常_第2张图片

 

要加这三个群的+微信好友:LTingUY1024(备注想加的群)

禁培训机构、禁广告推销、禁非IT行业招聘,求职。

此群的意义在于 方便成都地区IT招聘兼职、私活、学习、求职使用。

本人也将不定时的发布招聘JAVA、前端、UI等IT相关的兼职、私活工作,欢迎大家加入。

你可能感兴趣的:(异常记录,maven,java,阿里云)