0

I have a post-build script written in Groovy in my maven-invoker-plugin setup. How can I access the console output of an integration test in this script? I want to check that certain text has been printed.

yegor256
  • 102,010
  • 123
  • 446
  • 597

2 Answers2

0

I think this is the property you are looking for:

https://github.com/apache/maven-invoker-plugin/blob/master/src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java#L147

Property: invoker.streamLogs
Default value: false
Description: Flag used to determine whether the build logs should be output to the normal mojo log.

See this method for how logging is handled:

https://github.com/apache/maven-invoker-plugin/blob/master/src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java#L2226

Nicholas DiPiazza
  • 10,029
  • 11
  • 83
  • 152
  • What is the name of the variable to use inside the post-build script to read the content of the log? – yegor256 Nov 16 '21 at 18:59
0

The entire log is stored into the build.log file, which is placed in the logDirectory.

yegor256
  • 102,010
  • 123
  • 446
  • 597