[ https://jira.codehaus.org/browse/SUREFIRE-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=305857#comment-305857 ]
Marco Brandizi commented on SUREFIRE-900: ----------------------------------------- Thanks for your reply. System.setErr() solved my specific problem. In general, it's strange for me that one cannot do something as easy as mvn test 2>/dev/null and see just the standard output, not the standard error, which might give non-useful information in certain situations. But OK, I can live with that. > System.err seems to be ignored > ------------------------------ > > Key: SUREFIRE-900 > URL: https://jira.codehaus.org/browse/SUREFIRE-900 > Project: Maven Surefire > Issue Type: Bug > Affects Versions: 2.7.2 > Environment: OS/X 10.7.4 > Reporter: Marco Brandizi > Assignee: Kristian Rosenvold > Priority: Minor > Attachments: testSureFireStdErr.zip > > > See the attached project. If I send something to System.err from a JUnit test > and then I try 'mvn test 2>/dev/null', I can still see the output on the > console, surefire (or Maven?!) seems to ignore this. I've tried with > -Dsurefire.forkMode=false too. Is it possible to redirect the standard error? > I'd like to do that because I have a few tests that tests a line command (ie, > main()). Since the command is supposed to return XML to the invoker (which, > for example, might pipe it to another command), I've implemented this command > line by sending all the logging output to System.err (that's possible in > Logback via the 'Target' option in the Console appender). When I invoke this > line command outside Maven/Surefire it works as I want. In Maven, instead, I > cannot what I described. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira