9

我正在尝试安装 stanbol 并收到以下错误

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

附加错误日志

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

6 回答 6

14

看起来您正在使用的库中有一些测试被破坏。

如果您想了解测试错误的详细信息,请查看 /home/stanbol-trunk/entityhub/ldpath/target/surefire-reports。

如果你想安装lib,你可以运行mvn clean install -DskipTests

希望能帮助到你!

于 2015-07-04T13:42:40.007 回答
3

右键单击项目->“作为 Maven 测试运行”。这将自动下载缺少的插件。& 之后,右键单击项目->“更新 Maven 项目”它删除了错误

于 2016-04-12T22:12:55.610 回答
2

@SpringBootApplication注解包含这些配置。

1)@配置

2)@ComponentScan

3)@EnableAutoConfiguration

@EnableAutoConfiguration是此错误的原因。这将尝试根据您的 pom.xml 中的依赖项自动配置应用程序

例如,当您在 pom 中具有 spring-data-jpa 依赖项时,它将尝试通过查看 application.properties 文件的数据源来向应用程序添加配置。所以你需要添加数据源来解决这个问题。

mvn clean install -DskipTests将帮助您跳过测试,直到您解决错误。

于 2018-01-05T07:11:02.683 回答
1

如果您在构建 Maven 项目时遇到上述问题。然后请尝试将以下代码放入您的 pom.xml 文件中。

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

由于surefire插件的版本可能不正确或未下载,可能会出现问题。

于 2018-11-07T01:19:28.290 回答
0

Also, this issue may occur if you changed the path to your tests. In that case, the tests cannot be found and therefore executed.

于 2019-05-11T11:07:12.477 回答
-1

您可以在 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>
于 2018-05-12T08:30:13.133 回答