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

时间:2014-05-21 13:26:59

标签: java eclipse spring maven maven-plugin

我正在使用Maven 3.0.5和Spring Tool Source 3.2和Maven插件 安装。当我尝试做“跑步”时,> Maven安装',我得到了 以下错误:

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

3 个答案:

答案 0 :(得分:0)

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

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

答案 1 :(得分:0)

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

答案 2 :(得分:0)

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

解决方案

  1. 删除maven repo 〜/ .m2 / repository
  2. 然后重新构建
  3. 它对我有用。