一般是这一行或者第一行报错:
CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-plugin-api:jar:2.0.9, org.apache.maven:maven-artifact:jar:2.0.9, org.apache.maven:maven-core:jar:2.0.9: Failure to transfer org.apache.maven:maven-plugin-api:jar:2.0.9 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:maven-plugin-api:jar:2.0.9 from/to central (https://repo.maven.apache.org/maven2): connect timed out。
原因:文件没有下载完成。
解决方法1:
在电脑中搜索xxx.jar.lastUpdated,并将其都删除即可,具体步骤如下:
1)找到 {user}/.m2/repository
2)搜索“.lastupdated”。(如果不记得对应的.m2位置,可以全计算机搜索)Windows将展示所有文件夹的目录。
3)选中对应的lastupdated文件,并删除。
4)重新打开(若先前未关闭,请关闭后重新打开)Eclipse,右键报错的项目,并选择Maven > Update Project。同时记得勾选Force Update of Snapshots/Releases”. 点击OK,这样就解决了依赖关系。
解决方法2 :
1)找到 {user}/.m2/repository
2)将里面文件全部删掉
3)重新打开(若先前未关闭,请关闭后重新打开)Eclipse,右键报错的项目,并选择Maven > Update Project。同时记得勾选Force Update of Snapshots/Releases”. 点击OK,这样就解决了依赖关系。