gpt4 book ai didi

java - Maven 在控制台中显示 System.Out

转载 作者:行者123 更新时间:2023-12-03 09:12:26 25 4
gpt4 key购买 nike

我已经用 Java (JUnit) 编写了一个测试用例,当我使用 maven (mvn test) 运行测试时,我的 System.Out.Println 将不会显示在控制台中。有没有任何解决方案,或者这是否可能,因为我在网上找不到任何东西。

最佳答案

尝试通过以下方式运行测试:

mvn test -Dsurefire.useFile=false

或者将其添加到pom.xml:

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-version)</version>
<configuration>
<useFile>false</useFile>
</configuration>
</plugin>

来自the docs

useFile:

Option to generate a file test report or just output the test report to the console.

Type: boolean

Required: No

User Property: surefire.useFile

Default: true

关于java - Maven 在控制台中显示 System.Out,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40906108/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com