MyEclipse使用maven新建web项目时pom.xml第一行报错

报错如下:

Failure to transfer org.apache.maven.plugins:maven-war-plugin:pom:2.1.1 from http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-war-plugin:pom:2.1.1 from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public/): The operation was cancelled.

 

报错原因

上面标红的地方是报错的位置,对应着本地maven仓库中的文件夹位置:E:\Environment_variable\apache-maven-3.6.1\maven-repo\org\apache\maven\plugins\maven-war-plugin\2.1.1

(标黄的位置是你自己的maven仓库位置)

因为web项目打的是war包,并且是通过maven的打包插件 maven-war-plugin 打包的。

 

步骤:

1、所以我们进入 {你自己本地maven仓库路径}\org\apache\maven\plugins\maven-war-plugin\2.1.1 该目录下,你会发现只有一个文件,那就是没有下载成功。

  • 需要根据自己的报错信息:我的是 2.1.1 版本报错。

2、删除该目录下的文件

3、右键,更新项目即可!

img

  

4、下载成功如图所示:

img

 

一切的环境问题,都是没有下载或者配置没有成功,多经历吧!

posted @ 2020-05-27 15:55  忘忧山的兰木  阅读(643)  评论(0编辑  收藏  举报
她只是想吃这个而已啊……这一定是她非常爱吃的,我居然连如此细微的幸福也夺走了……
Hide
Switch
Save