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

[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

当前回答

分叉的VM没有正确地说再见就终止了。虚拟机崩溃或系统崩溃。出口被称为

防止此错误的方法是以管理员身份运行IDE。

其他回答

我使用的文件夹名为test&demo,所以它给出了这个问题(虚拟机没有正确地说再见就终止了。虚拟机崩溃或系统崩溃。退出调用),但当我给文件夹名称为test_demo,然后它解决了这个问题。(有“&”符号的windows操作系统存在此问题。)

将“&”替换为“_”

此问题可能是由文件夹名称中的一些特殊符号或额外空格引起的。

在使用maven测试运行单元测试时,我也遇到了同样的问题。 我试过改变那些肯定会成功的版本,但不管用。 最终成功解决如下问题: 早些时候:(当问题发生时): Javac来自JDK 1.8 Java指向JDK 1.11中的Java bin 当前:(当问题得到解决时): javac和Java都指向JDK 1.8中的bin

问候 泰娅。

在将Maven从2.6.3更新到2.8.4之后,我遇到了同样的问题。问题是分叉JVM崩溃的内存不足,所以只是增加内存从1024Mb到2048Mb在Surefire插件配置,这解决了这个问题

        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <!--suppress UnresolvedMavenProperty -->
                <argLine>${argLine} -Dfile.encoding=UTF-8 -Xmx2048m</argLine>
            </configuration>
        </plugin>

我有这么多时间,对我来说,这几乎总是与“控制台”有关,与实际的分叉无关。

总之,我的解决方案是:

添加-B(批处理模式) 添加JVM参数-Djansi。力= true -Djansi.passthrough = true

在一个给定的项目中,这将在一个新的windows控制台系统失败(cmd.exe)

[path_to_jdk] \ java.exe -Dmaven.home=[path_to_maven]\apache-maven-3.6.3 -Dclassworlds.conf=[path_to_maven]\bin. \bin\m2.conf -Dmaven.home=[path_to_maven]multiModuleProjectDirectory = path_to_myproject -Dfile。utf - 8编码= -Djansi。力= true -Djansi。passthrough=true -classpath [path_to_maven]\boot\plexus-classworlds-2.6.0.jar org.codehaus.plexus.classworlds.launcher.Launcher清洁安装

这将始终在一个新的控制台窗口(cmd.exe)中工作。

[path_to_jdk] \ java.exe -Dmaven.home=[path_to_maven]\apache-maven-3.6.3 -Dclassworlds.conf=[path_to_maven]\bin. \bin\m2.conf -Dmaven.home=[path_to_maven]multiModuleProjectDirectory = path_to_myproject -Dfile。utf - 8编码= -Djansi。力= true -Djansi。passthrough=true -classpath [path_to_maven]\boot\plexus-classworlds-2.6.0.jar org.codehaus.plexus.classworlds.launcher.Launcher清洁安装

注意,这两个命令都有-B(批处理模式,应该关闭着色),唯一的区别是

-Djansi.force=true -Djansi.passthrough=true

现在我只需要能够将这些“JVM参数”传递给“mvn”。Cmd”以使其更好。

我猜是这样的:有没有一种方法通过命令行将jvm参数传递给maven?


一点背景知识:

从maven (3. exe)的最新版本开始,我就反复遇到这个问题。x +)。 我尝试过这里的许多解决方案,有时运气好,有时不好。

这篇来自官方文档的文章一直都没用:https://maven.apache.org/surefire/maven-surefire-plugin/examples/class-loading.html

但有一些常数,当我处理这个问题时

总是在窗口,本地 总是有大量的控制台输出。 并不是所有的团队开发人员都会在特定项目中犯错误 Jenkins的构建会通过 IT测试中的大量控制台输出(故障安全集成测试)

关键的发现是,我注意到在Eclipse中(有或没有嵌入式maven版本),完整的maven构建(干净安装)都可以工作。

因此,我弄清楚了Eclipse使用的是哪个命令(谢谢:我如何获得Eclipse运行配置的命令行?)

从那里,我可以确定解是什么。

看看人们说的其他答案

输出到日志文件 降低日志级别 https://stackoverflow.com/a/52033799/1634131 https://stackoverflow.com/a/64132709/1634131 等

这里显然有一个bug。或者在Maven中,或者在windows控制台中,或者在Jansi库中,或者在这些组件的集成中。

在我的案例中,这个问题与工作区路径太长有关。所以我做了一个路径重构,这解决了我的问题。