首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Maven surefire非法参数异常

Maven surefire非法参数异常
EN

Stack Overflow用户
提问于 2019-11-04 22:49:40
回答 1查看 306关注 0票数 0

在Java jar上运行Junit 5测试并加载依赖项时,会出现警告

代码语言:javascript
复制
Corrupted STDOUT by directly writing to native stream in forked JVM 1. See FAQ web page and the dump file O:\VSTS\_work\2\s\target\surefire-reports\2019-11-04T13-14-53_351-jvmRun1.dumpstream

当我去查看dumpstream时,它充满了这样的评论:

代码语言:javascript
复制
Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream '13:14:57.199 6960-Log            dbug    system      Thread::GoThread                    Thread 6960-Log started.'.
java.lang.IllegalArgumentException: Stream stdin corrupted. Expected comma after third character in command '13:14:57.199   6960-Log            dbug    system      Thread::GoThread                    Thread 6960-Log started.'.
    at org.apache.maven.plugin.surefire.booterclient.output.ForkClient$OperationalData.<init>(ForkClient.java:507)
    at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.processLine(ForkClient.java:210)
    at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:177)
    at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:88)
    at java.lang.Thread.run(Thread.java:745)

surefire booterclient出了什么问题?

要设置的每个Maven surefire could not find ForkedBooter class

代码语言:javascript
复制
<useSystemClassLoader>false</useSystemClassLoader>

解决了依赖加载问题,但没有解决损坏的流。

EN

回答 1

Stack Overflow用户

发布于 2019-11-04 23:12:04

通过将forkCount设置为0解决了该错误

代码语言:javascript
复制
<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>${maven-surefire-plugin.version}</version>
    <configuration>
        <forkCount>0</forkCount>
        <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
        <systemPropertyVariables>
          <useSystemClassLoader>false</useSystemClassLoader>
          <concordion.output.dir>target/concordion</concordion.output.dir>
        </systemPropertyVariables>
    </configuration>
</plugin>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58695823

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档