无法执行目标org.apache.maven.plugins:maven-resources-plugin:2.5:资源

问题描述 投票:3回答:3

我正在使用Maven 3.0.5和Spring Tool Source 3.2并安装了Maven插件。当我尝试'Run As ---> Maven install'时,我收到以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project mavencxf: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed: A required class was missing while executing org.apache.maven.plugins:maven-resources-plugin:2.5:resources: org/codehaus/plexus/util/Scanner
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-resources-plugin:2.5
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/Mindbowser-MB/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.jar
[ERROR] urls[1] = file:/C:/Users/Mindbowser-MB/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar
[ERROR] urls[2] = file:/C:/Users/Mindbowser-MB/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar
[ERROR] urls[3] = file:/C:/Users/Mindbowser-MB/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
[ERROR] urls[4] = file:/C:/Users/Mindbowser-MB/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[5] = file:/C:/Users/Mindbowser-MB/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[6] = file:/C:/Users/Mindbowser-MB/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
[ERROR] urls[7] = file:/C:/Users/Mindbowser-MB/.m2/repository/org/apache/maven/shared/maven-filtering/1.0/maven-filtering-1.0.jar
[ERROR] urls[8] = file:/C:/Users/Mindbowser-MB/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
[ERROR] urls[9] = file:/C:/Users/Mindbowser-MB/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------: org.codehaus.plexus.util.Scanner
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
java eclipse spring maven maven-plugin
3个回答
0
投票

A required class was missing while executing org.apache.maven.plugins:maven-resources-plugin:2.5:resources: org/codehaus/plexus/util/Scanner

资源插件缺少依赖项;但它应该自动下载,...你是否处于离线模式?如果您上网并执行它,它应该自动下载缺少的依赖项。


0
投票

我的问题在于POM.XML文件中定义的存储库。我删除它们以便它使用默认仓库并解决了我的问题。


0
投票

当存储库出现问题时,这种情况发生在我身上,然后即使我再次运行maven,它仍然失败了。

解:

  1. 删除maven repo~ / .m2 / repository
  2. 然后重新构建

这个对我有用。

© www.soinside.com 2019 - 2024. All rights reserved.