如何解决maven 2.6资源插件依赖?

时间:2015-07-09 11:39:00

标签: java eclipse rest maven m2eclipse

ERROR:

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

解决方案:

更新项目:无法从maven的REPO下载。

尝试将特定jar放入.m2 repo。

的文件夹中

如果需要,可以提供参考。

11 个答案:

答案 0 :(得分:26)

您的settings.xml文件似乎缺少您的.m2(本地maven repo)文件夹。

使用eclipse时导航到Window - >偏好 - > Maven - >用户设置 - >浏览到您的settings.xml,然后点击“应用”。

然后做maven更新项目。

enter image description here

答案 1 :(得分:8)

右键单击Project转到 - > Maven - >更新项目 - >选择强制更新项目复选框,然后单击完成。

答案 2 :(得分:6)

在Windows上:

  1. 从C:\ Users \ USER.m2
  2. 中删除文件夹
  3. 关闭并打开项目或强制更改文件:pom.xml以保存:)

答案 3 :(得分:5)

如果由于某种原因下载失败,Maven将不会尝试在特定时间范围内下载(它会留下带有时间戳的文件)。

要解决此问题,您可以

  • 清除(部分).m2 repo
  • 使用-U运行maven以强制更新

答案 4 :(得分:3)

步骤1:检查eclipse中配置的代理是否正确? (Window-> Preferences-> General-> Network Connections)。

第2步:右键单击Project->去Maven - >更新项目

第3步:以Maven安装方式运行。

====通过以下步骤,我可以解决此错误。

答案 5 :(得分:1)

我遇到了同样的问题。尝试在conf / settings.xml中声明缺少的插件。

<build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.6</version>
        </plugin>           
      </plugins>
    </pluginManagement>   
</build>

答案 6 :(得分:1)

This issue is happening due to change of protocol from http to https for central repository. please refer following link for more details. https://support.sonatype.com/hc/en-us/articles/360041287334-Central-501-HTTPS-Required 

In order to fix the problem, copy following into your pom.ml file. This will set the repository url to use https.

<repositories>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
        </pluginRepository>
    </pluginRepositories>

答案 7 :(得分:0)

我有完全相同的错误。我的网络是公司的内部网络。我为java开发人员下载了neon-eclipse。这些步骤对我有用:

1-我在我的电脑上下载了一个VPN客户端,完全被网络所蒙蔽。 Shellfire我曾经使用过。使用免费帐户并连接到Shellserver。

2-在Windows防火墙内部,我添加了Eclipse的传入规则。导航到找到eclipse exe的位置。

3-执行Maven更新项目。

然后项目能够从maven存储库中获取。

希望它有所帮助。

答案 8 :(得分:0)

尝试了一切。我删除了m2e并安装了m2e版本2.7.0。然后删除.m2目录并强制更新maven。有效!

答案 9 :(得分:0)

这为我解决了同样的问题: 我的eclipse安装在/usr/local/bin/eclipse

1)将eclipse的权限从root更改为所有者:sudo chown -R $USER eclipse

2)右键点击project/Maven右键点击Update Maven选择Force update maven project

答案 10 :(得分:0)

我有完全相同的错误。我的网络是公司的内部公司。代理已被IT团队禁用,因此我们不必启用任何代理设置。我已经从以下提到的位置C:\ Users \ vijay.singh.m2 \ settings.xml中注释了settings.xml文件中的代理设置。    这为我解决了相同的问题