当前位置: 首页 > 知识库问答 >
问题:

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

唐俊英
2023-03-14
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安装为目标,而不是像这里描述的嵌入式安装(这不起作用)

    无法计算生成计划:工件org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3在本地存储库中不可用

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

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

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

  • 共有1个答案

    施敏达
    2023-03-14

    我也有同样的问题。

    [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、eclipse Kepler和JBoss Dev Studio7。位于内部网络上的计算机,具有到html" target="_blank">Internet的代理。我是这么做的。

    0.检查maven Repository服务器是否已启动

    <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.检查not Eclipse问题

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

    如果'mvn compile'有效。但是在eclipse中使用maven插件不起作用,请参见maven插件不使用eclipse的代理设置

      <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)中,然后重新运行'mvncompile'。这就解决了问题。

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

    我以与上面相同的方式处理这个问题,从http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin/2.10和http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-install-plugin/2.3.1下载

     类似资料: