研究maven多模块项目时,由于家里和公司不能同时开发,因此把家里搭建好的项目复制到公司继续研究,apache
当时家里的电脑搭建好项目以后是没问题的,可是复制到公司的eclipse上以后就看到pom文件出现下面的错误:缓存
Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution: default-testCompile, phase: test-compile)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (execution: default-compile, phase: compile)
- CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be
resolved: The repository system is offline but the artifact com.google.collections:google-collections:jar:1.0 is not available in the local repository.
- 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 repository system is offline but the artifact com.google.collections:google-collections:jar:1.0 is not available in the local repository.
网上搜罗一大堆都没找到解决办法,最后在一个英文文档找到了解决方案,翻译是这样的服务器
这不是一个独特的问题,偶尔发生(有时因为链接缓慢,有时因为代理服务器如今容许下载)
你能够经过如下任何一种方式来摆脱这个问题:
1)强制更新:右键单击Eclipse中的项目> Maven >更新项目在该屏幕上选择快照/发布的复选框强制更新
2)清除Maven缓存:若是您仍然面临问题,请转到系统上的本地存储库,该库可能存在ATC:\\\用户\ MyUrNeNe\\M2\ReaviToRyy,并删除.cache文件夹,而后执行步骤1。
3)若是仍然面临问题,手动转到ORG/Apache文件夹,删除全部内容,而后执行步骤1。(这确定会解决这个问题。)
我用了第三种方法,意思就是将你的maven仓库全删掉,从新下载一遍,使用如下流程:eclipse
一、找到你的maven仓库包位置,删掉repository文件夹下的全部文件,maven
二、而后右击项目->maven->update maven configuration...this
offline和fore update of snapssots/Releases(强制更新)必定要勾选上,google
下载完以后你会发现,问题解决了!!!翻译
若是还不能解决,在pom文件加个依赖:代理
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</dependency>ip
这样就好了