Java Maven错误:无法计算生成计划

Java Maven错误:无法计算生成计划,java,eclipse,maven,Java,Eclipse,Maven,我得到以下错误,我不知道为什么。我已经在多个环境中设置了我的项目,我从来没有遇到过任何问题,但最近我将项目添加到运行Windows 8的环境中,并且所有设置都正确(例如Maven…),我似乎遇到了这个问题 Multiple annotations found at this line: - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plu

我得到以下错误,我不知道为什么。我已经在多个环境中设置了我的项目,我从来没有遇到过任何问题,但最近我将项目添加到运行Windows 8的环境中,并且所有设置都正确(例如Maven…),我似乎遇到了这个问题

Multiple annotations found at this line:
    - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (execution: default-compile, phase: compile)
    - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (execution: default-testCompile, phase: test-compile)
    - CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read 
     artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1: ArtifactResolutionException: Could not transfer artifact org.apache.maven.plugins:maven-compiler-
     plugin:pom:2.5.1 from/to central (http://repo.maven.apache.org/maven2): Address family not supported by protocol family: connect
    - CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read 
     artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 
     from http://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.plugins:maven-compiler-plugin:pom:2.5.1 from/to central (http://repo.maven.apache.org/maven2): Address family not supported 
     by protocol family: connect

我在网上看到了这一点,并尝试了下面列出的许多不同的方法来尝试解决这个问题,但它们似乎都不起作用。请注意,我没有使用任何代理

  • 删除.m2存储库,Maven->更新项目
  • 删除所有
    .lastUpdated
    文件,Maven->更新项目
  • 更新项目时尝试选择“强制更新快照/发布”

有人对我可以尝试什么有其他想法吗?

您的项目似乎没有安装所需的依赖项。 因此,您需要自己安装它

从Maven存储库下载jar和pom文件,并使用命令安装(比直接复制到文件夹更好)

mvn安装:安装文件-Dfile=-DpomFile=

还要确保您已经安装了项目所需的所有存储库,并在
.m2/repository
文件夹中与jar文件进行交叉验证。在Eclipse中,转到Windows>Preferences>Maven>User Settings


在用户设置中,在字段中填入
Settings.xml
%M2\u HOME%\conf
(或正确的路径)。

在新VM上设置项目时,我遇到了类似的错误:"CoreException:无法计算生成计划:Plugin org.apache.maven.插件:maven编译器插件:2.5.1或其一个依赖项无法解析:未能读取org.apache.maven的工件描述符。插件:maven编译器插件:jar:2.5.1:工件解析异常:传输失败plugins:maven编译器plugin:pom:2.5.1 from缓存在本地存储库中,在经过central的更新间隔或强制更新之前,不会重新尝试解析。原始错误:无法将工件org.apache.maven.plugins:maven编译器plugin:pom:2.5.1从/传输到中心():连接超时

在我的案例中,原因和解决方法: 我在系统上安装了apache-maven-3.2.5,但发现 settings.xml文件在我的用户名(C:\Users\MyUserName.M2)下的.M2文件夹中丢失,因此在生成项目时出现上述错误

修复步骤:

步骤1:将settings.xml从C:\Users\Public.m2复制到VM上我的用户名下的.m2文件夹(C:\Users\MyUserName.m2

步骤2:使用CMD在导航到项目后运行一个干净的安装,以查看问题是否已修复,并且项目生成没有错误 这样地:
C:\Selenium\u Test\u SetupB\WebUatDemo>mvn clean install

即使您也可以尝试使用rm-rf手动清理.m2/repository/文件夹,然后重新构建项目。希望这对您有用。祝您好运。首先尝试在命令行上而不是在Eclipse中构建项目……除此之外。这个“地址族不受支持…”看起来像网络/firewall问题…Maven文档可能有助于确定
settings.xml
的路径:从Maven路径在IDE中配置settings.xml文件后,错误已修复。谢谢。
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
mvn install:install-file -Dfile=<path-to-file> -DpomFile=<path-to-pomfile>