Maven surefire VM 在 Eclipse Neon .3 上崩溃或分叉冻结

Maven surefire VM crashes or forking freezes on Eclipse Neon .3

当我 运行 来自 Eclipse(Neon.3,EE 版本)的 maven 命令 'mvn clean install' 我收到错误:

org.apache.maven.plugin.PluginExecutionException: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?

Eclipse 安装使用 m2e-plugin(默认)和 Java 1.8.0_131。但我也尝试过一些早期版本,包括 1.7.x.

试图寻找解决此问题的方法并发现: The forked VM terminated without saying properly goodbye. VM crash or System.exit called

尝试将以下配置添加到 pom.xml

<profiles>
    <profile>
        <id>normal_build_profile</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.20</version>
                    <configuration>
                        <!-- Tried with lots of different values, no change -->
                        <threadCount>3</threadCount>
                        <forkCount>3</forkCount>
                        <reuseForks>true</reuseForks>
                        <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

使用上面的配置,它在执行此命令时在 Eclipse 中冻结(来自日志)

[DEBUG] Forking command line: cmd.exe /X /C "C:\Java\jdk1.8.0_131\jre\bin\java -Xmx1024m -XX:MaxPermSize=256m -jar C:\workspace\miniTest\target\surefire\surefirebooter2156530837851203141.jar C:\workspace\miniTest\target\surefire 2017-06-08T08-58-59_461-jvmRun1 surefire2401124720884095509tmp surefire_03952770368534211516tmp"

但是当我从命令行 运行 'mvn clean install' 时,一切都很好。 Eclipse 配置为使用与在命令行中使用的相同的 Maven 安装。 Maven 版本为 3.5.0。 (虽然这也发生在 3.3.3 版本中)

因为这似乎与 运行ning 测试有关,我应该注意我也有这些:

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <!-- 4.11 Does not require that hamcrest dependency -->
    <version>4.12</version>
    <scope>test</scope>
</dependency>

<dependency>
    <groupId>org.hamcrest</groupId>
    <artifactId>hamcrest-all</artifactId>
    <version>1.3</version>
    <scope>test</scope>
</dependency>

有谁知道 Eclipse 发生了什么,因为这似乎与它有关?
从命令行构建相当不方便。
运行 在没有 Maven 的 Eclipse 中进行单元测试是可以的。

<threadCount>3</threadCount>
<forkCount>0</forkCount>
<reuseForks>false</reuseForks>

至少在我用来调试这个问题的情况下似乎可以解决问题。