mavenpom⽂件报错:Multipleannotationsfoundatthisli。。。研究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 le.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 le.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。(这肯定会解决这个问题。)
repository文件夹可以删除吗我⽤了第三种⽅法,意思就是将你的maven仓库全删掉,重新下载⼀遍,使⽤以下流程:
1、到你的maven仓库包位置,删掉repository⽂件夹下的所有⽂件,
2、然后右击项⽬->maven->update
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>
这样就⾏了

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。