简体   繁体   English

日食中缺少maven-surefire-plugin

[英]maven-surefire-plugin missing in eclipse

when I'm building a maven project I got this error ..... 当我正在构建一个maven项目时,我收到了这个错误.....

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.790s
[INFO] Finished at: Sun May 11 09:36:22 IST 2014
[INFO] Final Memory: 6M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test    (default-test) on project javaeeapp: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test failed: Unable to load the mojo 'test' in the plugin 'org.apache.maven.plugins:maven-surefire-plugin:2.10'. A required class is missing: org/apache/maven/plugin/surefire/SurefireReportParameters
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-surefire-plugin:2.10
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/NOughT/.m2/repository/org/apache/maven/plugins/maven-surefire-plugin/2.10/maven-surefire-plugin-2.10.jar
[ERROR] urls[1] = file:/C:/Users/NOughT/.m2/repository/org/apache/maven/surefire/surefire-booter/2.10/surefire-booter-2.10.jar
[ERROR] urls[2] = file:/C:/Users/NOughT/.m2/repository/org/apache/maven/surefire/maven-surefire-common/2.10/maven-surefire-common-2.10.jar
[ERROR] urls[3] = file:/C:/Users/NOughT/.m2/repository/org/codehaus/plexus/plexus-utils/2.1/plexus-utils-2.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------: org.apache.maven.plugin.surefire.SurefireReportParameters
[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] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

how I add maven surefire plugin to eclipse?? 我如何将even surefire插件添加到eclipse?

Add Maven Surefire Plugin in pom.xml . pom.xml添加Maven Surefire Plugin
Refer sample pom.xml here: 请参阅示例pom.xml

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.17</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.17</version>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

I also got the same error got resolved by going to add dependency and add the following dependency 1.maven surfire plugin 2.maven surfire common 3.surfire api 4.surfire booter 我也得到了相同的错误,通过添加依赖项并添加以下依赖项来解决1.maven surfire plugin 2.maven surfire common 3.surfire api 4.surfire booter

By downloading all this in my pom.xml My issue got resolved 通过在我的pom.xml中下载所有这些我的问题得到了解决

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM