且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Maven报告中的JUnit输出

更新时间:2023-09-30 11:11:16

我相信你可以使用maven surefire插件配置键 redirectTestOutputToFile 重定向测试的输出( System.out ),然后找到中的输出目标/ surefire-reports

I believe you can redirect the output (System.out) of test using the maven surefire plugin configuration key redirectTestOutputToFile, and then find the output in target/surefire-reports

插件文档

在一个snipplet中:

In one snipplet:

<build>
  <plugins>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <configuration>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
      </configuration>
      </plugin>
  </plugins>
</build>