gpt4 book ai didi

java - eclipse 中缺少 maven-surefire-plugin

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:33:29 26 4
gpt4 key购买 nike

当我构建一个 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

我如何将 maven surefire 插件添加到 eclipse??

最佳答案

pom.xml中添加Maven Surefire Plugin
请在此处引用示例 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>

关于java - eclipse 中缺少 maven-surefire-plugin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23588957/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com