当eclipse-mars导入maven项目时pom文件出现Failure to transfer org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.38 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.tomcat.embed:tomcat-embed-websocket:jar:9.0.38 from/to alimaven (http://maven.aliyun.com/nexus/
content/groups/public/):
如下图所示
第一种方法(未奏效)
出现这个问题好像是由于eclipse所能允许的Tomcat版本过低,更换新版本的eclipse可以解决问题
旧版本的eclipse允许的Tomcat版本不包括9.0版本
如下图所示
第二种方法:在maven配置中更换国内镜像
原因:在报错信息中提到Failure to transfer org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.38 from http://maven.aliyun.com/nexus/content/groups/public/说明在这个镜像下不能够下载Tomcat9.0.38版本,更换镜像
操作步骤:打开maven配置文件,在F:\developer\maven\apache-maven-3.6.3\conf(我电脑上maven安装路径)路径下的setting.xml文件在mirrors标签中更改镜像
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
问题成功解决!!!