开发者

How to output failed test's strack traces to the console [duplicate]

This question already has answers here: Make maven's surefire show stacktrace in console (3 answers) Closed 6 years ago.

I'm running a single test from Maven:

mvn test -Dtest=TestCircle

If the test fails, Maven outputs the exceptions in /target/... folder.

Is there a way to tell Maven that this exception should be printed direc开发者_开发问答tly on the console, so I don't have to look in /target/surefire-reports/...?


You can configure the surefire plugin to generate a file test report or just output the test report to the console using the useFile optional parameter:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.6</version>
    <configuration>
      <useFile>false</useFile>
    </configuration>
  </plugin>

Or, from the command line with the corresponding expression:

$ mvn test -Dsurefire.useFile=false
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜