mvn clean package报错 WagonTransporterFactory: java.util.NoSuchElementException

在eclipse中执行clean package指令报错,错误信息如下:

[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------------< com.demo:ws-demo >--------------------------
[INFO] Building ws-demo 0.0.1-SNAPSHOT
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.668 s
[INFO] Finished at: 2019-07-25T16:04:20+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:3.1.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:3.1.0: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:3.1.0 from/to public (http://******************.com/nexus/content/groups/public/): Cannot access http://******************.com/nexus/content/groups/public/ with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access http://******************.com/nexus/content/groups/public/ using the registered transporter factories: WagonTransporterFactory: java.util.NoSuchElementException
[ERROR]       role: org.apache.maven.wagon.Wagon
[ERROR]   roleHint: http
[ERROR] -> [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.  由于maven默认的下载服务器在国外,网络不好下载不好jar包,让修改maven_home/conf目录下的setting文件,增加阿里的下载镜像地址,然后重新下载插件;
  2.  删除插件在本地仓库中的目录,重新下载,不停的尝试,直到可行为止
  3. 等等等。。。。。。

小编在尝试上面的两种方式之后,最终的解决办法:

在cmd窗口进入到项目目录下,执行指令mvn clean package,然后就BUILD SUCCESS,试100次成功100次,回头再到eclipse中执行,也BUILD SUCCESS

个种原因我就不是很清楚,只是不再相信eclipse的这些插件了。还是老老实实在cmd窗口敲命令 

 

 

  • 4
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值