且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法计算构建计划:插件org.apache.maven.plugins:maven-resources-plugin:2.5或其一个依赖关系无法解析

更新时间:2022-10-19 16:58:29

我有完全相同的问题。

  [错误]插件org.apache.maven.plugins:maven-resources -plugin:2.5或其一个依赖关系无法解析:无法读取org.apache.maven.plugins的工件描述符:maven-resources-plugin:jar:2.5:找不到org.apache.maven.plugins:maven -resources-plugin:pom:2.5在http://repo.maven.apache.org/maven2缓存在本地存储库中,解决方案将不会被重新尝试,直到中间更新间隔过去或更新被强制 - > [帮助1] 
...

如果maven 3.0.5,eclipse开普勒与JBoss Dev Studio 7已安装。计算机坐在内部网络上,代理互联网。这是我做的。



0。检查maven仓库服务器是否正常



1。检查代理设置和工作



首先我以为这是一个代理问题,我确保maven settings.xml包含代理设置: p>

 <代理> 
< id>可选< / id>
< active> true< / active>
< protocol> http< / protocol>
< username> optional-proxyuser< / username>
< password> optional-proxypass< / password>
< host> proxy.host.net< / host>
< port> 80< / port>
< nonProxyHosts> local.net | some.host.com< / nonProxyHosts>
< / proxy>

,并检查代理是否正在尝试远程登录:

  telnet [proxy] [port number] 

2。检查不是Eclipse问题



在eclipse之外的命令行级别运行'mvn compile' - 同样的问题。



如果mvn compile有效。但是在eclipse中使用maven插件无效,请参阅不使用Maven插件eclipse的代理设置



3。检查不是缓存问题
删除我的本地maven存储库中的所有内容。 (默认位置:〜/ .m2 / repository)然后reran maven - 同样的问题出现。



4。对我有用的



自动下载&安装缺少的插件:
通过声明pluginManagement的POM文件构建部分中缺少的插件Maven将自动检索所需的插件。在POM文件中,添加您需要的插件版本的代码:

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

$ b

手动安装缺少的插件:
我去了 http://mvnrepository.com/ artifact / org.apache.maven.plugins / maven-resources-plugin / 2.5 ,并下载 maven-resources-plugin-2.5.jar maven-resources-plugin-2.5.pom 。将它直接复制到maven仓库到正确的文件夹(〜/ .m2 / repository / org / apache / maven / plugins / maven-resources-plugin / 2.5)并重新编译'mvn compile'。这解决了这个问题。






Edit1



此后,我有另外两个问题:'mvn install':

  org.apache.maven的POM。插件:maven-surefire-plugin:jar:2.10缺少,没有依赖关系信息

org.apache.maven.plugins的POM:maven-install-plugin:jar:2.3.1缺少,没有依赖关系信息

我以上述方式解决了这个问题,从 http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-install-plugin/2.3.1


org.apache.maven.plugin.PluginResolutionException: 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
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:129)
    at org.eclipse.m2e.core.internal.project.registry.EclipsePluginDependenciesResolver.resolve(EclipsePluginDependenciesResolver.java:48)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:142)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:261)
    at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:185)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:152)
    at org.eclipse.m2e.core.internal.embedder.MavenImpl.setupMojoExecution(MavenImpl.java:386)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.setupMojoExecution(ProjectRegistryManager.java:865)
    at org.eclipse.m2e.core.internal.project.registry.MavenProjectFacade.getMojoExecution(MavenProjectFacade.java:355)
    at org.eclipse.m2e.core.project.configurator.AbstractCustomizableLifecycleMapping.getBuildParticipants(AbstractCustomizableLifecycleMapping.java:66)
    at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:87)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:414)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:351)
    at org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob.runInWorkspace(UpdateMavenProjectJob.java:74)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:296)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:279)
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:115)

I have read where many people were able to solve this by:

I am new to Maven so please excuse any of my ignorance

This project is working on another machine, and just pulled it down from the repository on this one, with the same version of eclipse and m2e plugin installed. I have been fooling with this for over 10 hours now and it is driving me nuts (Maven has been nothing but headaches for me so far...) Any help is tremendously appreciated! Thanks in advance!

EDIT

After looking closer I did notice that it is not downloading the .jar files into the local repository... I am not sure if that is something obvious...

EDIT

I am not given the option to add Maven Dependencies to the build path.

I had the exact same problem.

[ERROR] 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: Failure to find org.apache.maven.plugins:maven-resources-plugin:pom:2.5 in 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 -> [Help 1]
...

Had maven 3.0.5, eclipse Kepler with JBoss Dev Studio 7 installed. Computer sitting on internal network with proxy to the internet. Here's what I did.

0. Check the maven repositiory server is up

1. Check Proxy is set up and working

First I thought it was a proxy problem, I made sure that maven settings.xml contained the proxy settings:

<proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <username>optional-proxyuser</username>
  <password>optional-proxypass</password>
  <host>proxy.host.net</host>
  <port>80</port>
  <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>

and checked that the proxy is working by trying to telnet to it:

telnet [proxy] [port number]

2. Check not Eclipse Issue

ran 'mvn compile' at command line level outside of eclipse - same issue.

If 'mvn compile' worked. But it doesn't work using the maven plugin in eclipse, see Maven plugin not using eclipse's proxy settings

3. Check not Cache Issue Deleted all contents in my local maven repository. (Default location: ~/.m2/repository) And then reran maven - same issue came up.

4. What worked for me

Automatically download & install missing plugin: By declaring the missing plugin in the POM file build section for pluginManagement Maven will automatically retrieve the required plugin. In the POM file, add this code for the version of the plugin you require:

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

Manually install missing plugin: I went to http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin/2.5 and downloaded maven-resources-plugin-2.5.jar and maven-resources-plugin-2.5.pom . Copied it directly into the maven repository into the correct folder ( ~/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.5) and reran 'mvn compile'. This solved the problem.


Edit1

Following this I had another two problem with 'mvn install':

The POM for org.apache.maven.plugins:maven-surefire-plugin:jar:2.10 is missing, no dependency information available

The POM for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1 is missing, no dependency information available

I approached this problem the same way as above, downloading from http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin/2.10 and http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-install-plugin/2.3.1