简体   繁体   English

无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test

[英]Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test

I am trying to install stanbol and getting the following error 我正在尝试安装stanbol并收到以下错误

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test

Attaching the error log 附加错误日志

[INFO] 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project org.apache.stanbol.entityhub.ldpath: There are test failures. [ERROR]  [ERROR] Please refer to /home/stanbol-trunk/entityhub/ldpath/target/surefire-reports for the individual test results.

[ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project org.apache.stanbol.entityhub.ldpath: There are test failures.

Please refer to /home/stanbol-trunk/entityhub/ldpath/target/surefire-reports for the individual test results.   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)  at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)  at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)  at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:606)     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)  at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)  at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /home/stanbol-trunk/entityhub/ldpath/target/surefire-reports for the individual test results.   at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:82)  at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:254)   at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:854)    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:722)     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)  ... 19 more

[ERROR] 

[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/MojoFailureException

[ERROR] 

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :org.apache.stanbol.entityhub.ldpath

It looks like you have some tests broken in the lib you are using. 看来您正在使用的库中破坏了一些测试。

Look at /home/stanbol-trunk/entityhub/ldpath/target/surefire-reports if you want details of the test errors. 如果需要测试错误的详细信息,请查看/ home / stanbol-trunk / entityhub / ldpath / target / surefire-reports。

If you want to install the lib anyway you can run mvn clean install -DskipTests 如果仍要安装该库,则可以运行mvn clean install -DskipTests

Hope it helps! 希望能帮助到你!

Right Click on project -> "Run as Maven Test". 右键单击项目->“以Maven测试运行”。 This will automatically download the missing plugin. 这将自动下载缺少的插件。 & after that, Right Click on project ->"Update Maven project" it removes the error 然后,右键单击项目->“更新Maven项目”,它会删除错误

@SpringBootApplication annotation contains these configurations. @SpringBootApplication批注包含这些配置。

1) @Configuration 1)@配置

2) @ComponentScan 2)@ComponentScan

3) @EnableAutoConfiguration 3)@EnableAutoConfiguration

@EnableAutoConfiguration is the reason for this error. @EnableAutoConfiguration是此错误的原因。 This will try to automatically configure application according to dependencies in your pom.xml 这将尝试根据pom.xml中的依赖关系自动配置应用程序

As a example when you have spring-data-jpa dependency in pom it will try to add configuration to application by looking at application.properties file for data source. 例如,当您在pom中具有spring-data-jpa依赖项时,它将通过查看数据源的application.properties文件来尝试向应用程序添加配置。 So you need add data source to solve that. 因此,您需要添加数据源来解决该问题。

mvn clean install -DskipTests will help you to skip testing until you solve the error. mvn clean install -DskipTests将帮助您跳过测试,直到解决错误。

If You are facing above problem while building your maven project. 如果在构建Maven项目时遇到上述问题。 Then please try to put below code in you pom.xml file. 然后,请尝试将以下代码放入pom.xml文件中。

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
            </plugin>
        </plugins>
    </build>

Problem might be occurring because version of surefire plugin might be incorrect or not downloaded. 由于surefire插件的版本可能不正确或未下载,因此可能会出现问题。

Also, this issue may occur if you changed the path to your tests. 另外,如果您更改测试的路径,则可能会发生此问题。 In that case, the tests cannot be found and therefore executed. 在这种情况下,将无法找到测试并因此执行测试。

You can add these tag in pom.xml 您可以在pom.xml中添加这些标签

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
                <skipTests>true</skipTests>
            </configuration>
        </plugin>
    </plugins>
</build>

暂无
暂无

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

相关问题 无法执行目标 org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test on project XYZ - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test on project XYZ 未能执行目标 org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.16:SAKAI中的测试错误 - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test error in SAKAI 未能在项目上执行目标 org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project 无法在项目上执行目标 org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project 无法执行目标 org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test (default-test) - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test (default-test) 无法在项目myserver上执行目标org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test(默认测试) - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project myserver 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test(default-test) - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) 尝试部署到 AZURE 时出错 无法执行目标 org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test - Error when trying to deploy to AZURE Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.10:test没有执行任何测试 - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test no tests were executed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM