maven pom文件报错:Multiple annotations found at this line 解决方案
研究maven多模块项目时,因为家里和公司不能同时开发,所以把家里搭建好的项目复制到公司继续研究,
当时家里的电脑搭建好项目之后是没问题的,但是复制到公司的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仓库全删掉,重新下载一遍,使用以下流程:
1、找到你的maven仓库包位置,删掉repository文件夹下的所有文件,
2、然后右击项目->maven->update maven configuration…
offline和fore update of snapssots/Releases(强制更新)一定要勾选上,
下载完之后你会发现,问题解决了!!!
如果还不能解决,在pom文件加个依赖:
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</dependency>
我就是 这么解决的!
原文地址:https://blog.csdn.net/qq_27184497/article/details/80091294
上一篇: java IO流文件的读写具体实例
下一篇: Aop实现日志处理
推荐阅读
-
JSP报错:解决Multiple annotations found at this line
-
关于maven插件,lifecycle-mapping org.codehaus.gmaven等插件在pom文件中报错解决方案
-
XML文件报错:Multiple annotations found at this line:
-
[maven]Multiple annotations found at this line
-
maven pom文件报错:Multiple annotations found at this line 解决方案
-
MyEclipse报错:Multiple annotations found at this line: - String cannot be resolved to a type解决方法实测