一尘不染

无法计算生成计划:Plugin org.apache.maven.plugins:maven resources Plugin:2.5或无法解析其依赖项之一

java

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)

我读过许多人能够通过以下方法解决此问题:

从本地存储库中删除的文件夹,并让它重新下载它(这并没有工作)

通过配置Eclipse的目标,而不是如这里所描述的嵌入一个Maven的安装(这并没有工作)

无法计算构建计划:artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3在本地存储库中不可用

我是Maven的新手,所以请原谅我的无知

这个项目正在另一台机器上工作,只是将它从该机器上的存储库中拉下来,并安装了相同版本的eclipse和m2e插件。我一直在愚弄它十多个小时,这让我发疯(到目前为止,Maven只是让我头疼…)任何帮助都将不胜感激!提前致谢!

编辑

仔细查看后,我确实注意到它没有将.jar文件下载到本地存储库中…我不确定这是否很明显…

编辑

我没有选择将Maven依赖项添加到构建路径的选项。


阅读 489

收藏
2020-03-02

共1个答案

一尘不染

我有同样的问题。

[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]
...

如果使用maven 3.0.5,则在安装了JBoss Dev Studio 7的情况下使Kepler偏食。计算机坐在内部网络与互联网的代理。这就是我所做的。

0.检查Maven存储库服务器是否启动

1.检查代理已设置并正常工作

首先,我认为这是一个代理问题,我确保maven settings.xml包含代理设置(settings.xml可以存在于MAVEN_HOME中的两个位置。另一个位于%userprofile%.m2 \中,后者优先级更高) :

<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>

并尝试通过远程登录到代理来检查代理是否正常工作:

telnet [proxy] [port number]

2.检查不是Eclipse问题

在Eclipse之外的命令行级别运行了“ MVN编译”-同样的问题。

如果“ MVN编译”工作。但这在eclipse中使用Maven插件不起作用,请参阅Maven插件未使用Eclipse的代理设置

3.选中“不缓存问题”,然后 删除本地maven存储库中的所有内容。(默认位置:〜/ .m2 /存储库),然后重新运行Maven-出现相同的问题。

4.对我有用的

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

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

手动安装缺少的插件: 我去了 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”。这样就解决了问题。

编辑1

之后,“ 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
2020-03-02