0

I am using exec-maven-plugin to execute some specific tests. I want to append the console output of the tests to a file, without hiding the console.
Is there any support provided in maven for the task?

  1. I used maven-antrun-plugin to execute the recorder task before the tests begin. That didn't work.

  2. I used 'tee' command to execute using exec-maven-plugin. That doesn't seem to work either.

  3. I checked using log4j with maven. But since i'm new to log4j logging, i couldn't debug the issue with it.

Is there any other way to do it?

r9891
  • 3,163
  • 1
  • 14
  • 12
  • That's a tough one. What happened when you used `tee`? – Andrew Logvinov Jul 18 '12 at 10:09
  • I gave the execution of `tee` as one of the `` and made it to run in background. But the problem is, I can't redirect the output of the next `` to `tee`. Here's the code I used. ` ... tee result.log...java...` Since there's no redirection, the result.log is getting created, but it's not getting populated. – r9891 Jul 18 '12 at 12:03

1 Answers1

0

Use the outputFile parameter: http://www.mojohaus.org/exec-maven-plugin/exec-mojo.html#outputFile

Program standard and error output will be redirected to the file specified by this optional field. If not specified the standard maven logging is used.

Type: java.io.File

Since: 1.1-beta-2

Required: No

Expression: ${exec.outputFile}

Community
  • 1
  • 1
Wim Deblauwe
  • 25,113
  • 20
  • 133
  • 211
  • The `outputFile` option will only redirect the output to the specified file. The output will not be visible on console. I dont want to hide the console output. – r9891 Jul 18 '12 at 09:40
  • Indeed, sorry I missed that part. – Wim Deblauwe Jul 18 '12 at 11:09
  • To avoid this post being removed, I've edited it to include the link contents so if the link breaks this won't be useless to future visitors. – jamesmortensen Nov 06 '13 at 03:13