无法计算构建计划。插件 org.apache.maven.plugins:maven-jar-plugin:2.3.2 或其某个依赖项无法解决

我在eclipse中创建一个Maven项目时,得到了以下错误信息。许多人在帖子中提到了settings.xml文件中的代理,也提到了刷新.m2文件夹,迫使它下载一个新的文件夹。这些对我都不起作用。我在工作中,在互联网选项中激活了代理设置。

错误信息:

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: 
Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: 
Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5

POM.XML:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.blahhhhhhhhhhhhhhhhh</groupId>
  <artifactId>HelloRESTEasy</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</project>



settings.xml:

  <proxies>
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxyserver.company.com</host>
      <port>8080</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
  </proxies>

尝试用rm -rf手动清理本地.m2/repository/文件夹,然后重新构建项目。在尝试了所有其他可能的方法(重新安装eclipse,在eclipse中指向正确的maven版本,代理设置等)后,我的方法奏效了。

评论(2)
解决办法

我现在解决了这个问题。但是它只在Netbeans中解决了。不知道为什么eclipse仍然不接受更改后的settings.xml。但是解决方案是删除/注释settings.xml中的User/Password参数。

之前。



      optional
      true
      http
      proxyuser
      proxypass
      proxyserver.company.com
      8080
      local.net|some.host.com

之后。



      optional
      true
      http
      proxyserver.company.com
      8080
      local.net|some.host.com

评论(0)

运行。

mvn -U dependency:go-offline

这对我来说是有效的。

评论(0)