Maven项目常见的小问题

pom.xml文件头报错

场景

例Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from https://repo.maven.apache.org/maven2 was cached in the local repository

解决方案

  • 找到本地maven仓库中maven-surefire-plugin对应的版本文件夹(一般在.. epositoryorgapachemavenplugins下),然后删除文件夹中maven-surefire-plugin-2.12.4.pom.lastUpdated
  • 右键点击项目 -> Maven -> Update Dependencies,问题就可以解决了
原文地址:https://www.cnblogs.com/htyj/p/7755672.html