请帮我解决这个问题。我不太明白日志中的错误是什么意思。

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.749s
[INFO] Finished at: Thu Apr 24 10:10:20 IST 2014
[INFO] Final Memory: 15M/37M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test (default-test) on project samples.simpleforwarding: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
[ERROR] Command wascmd.exe /X /C ""C:\Program Files\Java\jdk1.7.0_55\jre\bin\java" -Xmx1024m -XX:MaxPermSize=256m -jar E:\OpenDayLight\controller\opendaylight\samples\simpleforwarding\target\surefire\surefirebooter53410321571238933.jar E:\OpenDayLight\controller\opendaylight\samples\simpleforwarding\target\surefire\surefire86076271125218001tmp E:\OpenDayLight\controller\opendaylight\samples\simpleforwarding\target\surefire\surefire_01846991116135903536tmp"
[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/PluginExecutionException

当前回答

在我的例子中,我忘记在pom中添加依赖项:

      <dependency>
          <groupId>org.aspectj</groupId>
          <artifactId>aspectjweaver</artifactId>
          <version>1.8.5</version>
      </dependency>

只要确保你选择了正确的版本(目前1.8.9是最新的)

其他回答

添加配置文件后,我可以删除这个错误:

<profile>
            <id>surefire-windows-fork-disable</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <configuration>
                                <forkCount>0</forkCount>
                                <useSystemClassLoader>false</useSystemClassLoader>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

似乎这是一个关于maven的问题

在我的测试类中的一个静态成员变量调用一个方法来创建一个对象(在整个类的测试用例中使用),并且该方法导致了一个异常之后,我遇到了这个错误。

// Object created inside test class by calling a static getter.
// Exception thrown in getter:
private static Object someObject = SomeObject.getObject(...);

// ... <Object later used in class>

一些修复包括在每个测试用例中重新创建对象,并相应地捕获任何异常。或者通过在@BeforeTest方法中初始化对象并确保正确地构建对象。

我最近在JHipster 6.10.5使用spring-boot 2.2.7生成的应用程序中遇到了同样的问题。RELEASE和maven surefire插件3.0.0-M4。这是由于非常长的测试日志造成的超时。通过在pom.xml中的maven-surefire-plugin(在pluginManagement下)中添加以下配置参数来解决:

1200年< forkedProcessExitTimeoutInSeconds > < / forkedProcessExitTimeoutInSeconds >

看到https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html forkedProcessExitTimeoutInSeconds

您可以设置java选项

SET JAVA_OPTS='-Xmx1024m' XX:+UseLoopPredicate

MVN清洁安装

我在Ubuntu机器上的Jenkins构建过程中遇到了这个问题。

/var/log/syslog报告内存不足:Kill process 19557 (java) score 207或牺牲子进程。

因此,我给了Ubuntu机器更多的交换空间。从那以后,这个问题就不存在了。