maven异常:Could not calculate build plan

新建Maven项目的时候出现异常如下
CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 in http://repository.jboss.org/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced

原因

本地设置的镜像仓库中没有对应的jar导致的,可能是由于网络原因maven程序无法读取远程仓库的jar,这个时候可以查看本地仓库下是否出现.lastUpdated结尾的文件,如果存在这个问题也可以描述为
Maven下载jar包出现.lastUpdated结尾的文件问题及解决

解决

删除本地仓库下的所有文件
配置maven配置文件setting.xml下的中央仓库地址为阿里云的,具体操作是修改 maven 根目录下的 conf 文件夹中的 setting.xml 文件,在 mirrors 节点上,添加内容如下:


    
      alimaven
      aliyun maven
      http://maven.aliyun.com/nexus/content/groups/public/
      central        
    

cmd下执行mvn help:system,重启eclipse,再新建一个maven项目异常解决

你可能感兴趣的:(maven异常:Could not calculate build plan)