没有执行目标org.apache.maven.plugins:maven-resources-plugin:2.5:资源。

时间:2022-01-18 17:58:03

I am using Maven 3.0.5 and Spring Tool Source 3.2 with Maven plugin installed. When I try to do 'Run As---> Maven install', I am getting the following error :

我使用的是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 个解决方案

#1


0  

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

在执行org.apache.maven.plugins:maven-resources-plugin:2.5:resources: resources: org/codehaus/plexus/util/Scanner时,缺少一个必需的类

The resources plugin is missing a dependency; But it should download it automatically,... are you in offline mode? If you are go online once and execute it, it should download the missing dependencies automatically.

资源插件缺少一个依赖项;但它应该自动下载,……你处于离线模式吗?如果您上线一次并执行它,它将自动下载丢失的依赖项。

#2


0  

My problem was with the repositories defined in the POM.XML file. I removed them so that it would use the default repo and it solved my issue.

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

#3


0  

This happened to me once when something went wrong with the repository, and then even if I ran maven again, it still failed.

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

Solution:

解决方案:

  1. delete maven repo ~/.m2/repository
  2. 回购~ / .m2 /删除maven存储库
  3. and then re-build
  4. 然后重建

It works for me.

它适合我。

#1


0  

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

在执行org.apache.maven.plugins:maven-resources-plugin:2.5:resources: resources: org/codehaus/plexus/util/Scanner时,缺少一个必需的类

The resources plugin is missing a dependency; But it should download it automatically,... are you in offline mode? If you are go online once and execute it, it should download the missing dependencies automatically.

资源插件缺少一个依赖项;但它应该自动下载,……你处于离线模式吗?如果您上线一次并执行它,它将自动下载丢失的依赖项。

#2


0  

My problem was with the repositories defined in the POM.XML file. I removed them so that it would use the default repo and it solved my issue.

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

#3


0  

This happened to me once when something went wrong with the repository, and then even if I ran maven again, it still failed.

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

Solution:

解决方案:

  1. delete maven repo ~/.m2/repository
  2. 回购~ / .m2 /删除maven存储库
  3. and then re-build
  4. 然后重建

It works for me.

它适合我。