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

[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

当前回答

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

总之,我的解决方案是:

添加-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库中,或者在这些组件的集成中。

其他回答

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

总之,我的解决方案是:

添加-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库中,或者在这些组件的集成中。

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

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

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

当我遇到这个错误时,这是由于我的ulimit打开文件(ulimit -n)太低。它(不知何故)被设置为仅256:

% ulimit -n
256

在我增加限制后,错误消失了:

% ulimit -n 3072
% ulimit -n     
3072

您的系统可能不允许将限制设置得这么高。例如,当我试图使用更大的数字时,就会发生这种情况:

% ulimit -n 3073
ulimit: setrlimit failed: invalid argument

或者这可能低于您现有的限制,您可能面临不同的根本原因。

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

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

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

可能是因为你在你的项目中应用了一些更改,没有更新他们所有的引用。

在我的情况下,我得到这个错误,因为我已经更新了包的名称在我的项目,但我忘记更新他们的引用在TestNG.xml文件。通过修正,我解决了这个错误。