报错如下:
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_variableapache-maven-3.6.1maven-repoorgapachemavenpluginsmaven-war-plugin2.1.1
(标黄的位置是你自己的maven仓库位置)
因为web项目打的是war包,并且是通过maven的打包插件 maven-war-plugin 打包的。
步骤:
1、所以我们进入 {你自己本地maven仓库路径}orgapachemavenpluginsmaven-war-plugin2.1.1 该目录下,你会发现只有一个文件,那就是没有下载成功。
-
需要根据自己的报错信息:我的是 2.1.1 版本报错。
2、删除该目录下的文件
3、右键,更新项目即可!
4、下载成功如图所示: