当前位置:   article > 正文

false

usesystemclassloader setting has no effect when not forking

jenkins上运行接口测试用例报错:

Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project apitest: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /home/jenkins/workspace/dht-ceshi112 && /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Dfile.encoding=UTF-8 -jar /home/jenkins/workspace/dht-ceshi112/target/surefire/surefirebooter2365510698734909951.jar /home/jenkins/workspace/dht-ceshi112/target/surefire/surefire2899246126287720087tmp /home/jenkins/workspace/dht-ceshi112/target/surefire/surefire_07248019886580183342tmp
[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.xml中增加<useSystemClassLoader>false</useSystemClassLoader>解决,设置maven使用独立的类加载器
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<forkMode>once</forkMode>
<argLine>-Dfile.encoding=UTF-8</argLine>
<suiteXmlFiles>
<suiteXmlFile>${suiteXmlFiles}</suiteXmlFile>
</suiteXmlFiles>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
 

转载于:https://www.cnblogs.com/zjxyz2008zhangjuan/p/9944933.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/611851
推荐阅读
相关标签
  

闽ICP备14008679号