关于maven导入工程pom文件报错问题及解决

本文作者:合肥工业大学 管理学院 钱洋 email:[email protected]

目录

  • pom文件头报错
  • pom报错一般性问题

pom文件头报错

1.导入maven文件,经常遇到表头出错问题。报错:Failure to transfer org.apache.maven.shared:maven-filtering:pom:1.0-beta-2 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will
not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.shared:maven-
filtering:pom:1.0-beta-2 from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled.
其大致原因是org.apache.maven.shared:maven-filtering:pom已经存在了,而且不能被强制更新了。

关于maven导入工程pom文件报错问题及解决_第1张图片

怎么将其更新呢?

首先根据org.apache.maven.shared:maven-filtering:pom:1.0-beta-2这个目录在本地仓库中删除对应文件夹下的.lastUpdated后缀名的文件。

关于maven导入工程pom文件报错问题及解决_第2张图片

从新更新maven工程,就行了。
关于maven导入工程pom文件报错问题及解决_第3张图片

后来,问题解决了。
关于maven导入工程pom文件报错问题及解决_第4张图片

pom报错一般性问题

2。一般情况下,maven出错的问题,都是由于网络原因,导致maven包没有下载下来。
常见的解决方案是:

注意要把标红的项,勾上
关于maven导入工程pom文件报错问题及解决_第5张图片

如果,这个解决不了,根据第一个的思路,找到本地报错的文件夹,将该文件夹删除。重新更新maven工程一般就行了。

你可能感兴趣的:(java)