zoukankan      html  css  js  c++  java
  • 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\M2ReaviToRyy,并删除.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>

    这样就行了

  • 相关阅读:
    分页插件加MVC
    在ASP.NET MVC中,有使用angularjs
    EF比较权威的一篇
    WEBFORM中添加bootstrap套件
    MVC统一设置命名空间
    重新生成索引及重新组织索引
    Dapper.Contrib.Extensions问题
    API Test WebApiTestClient工具安装及使用
    API Test Postman接口测试之高级篇2
    API Test Postman接口测试之高级篇1
  • 原文地址:https://www.cnblogs.com/fengquan-blog/p/10368406.html
Copyright © 2011-2022 走看看