exec-maven-plugin
exec-maven-plugin copied to clipboard
Issue with async and outputFile
When I use both the async and outputFile option this does not seem to work. The output file is created but empty and the process hangs after a while trying to write to stdout.
I'm using 1.5.0 under Windows
The problem here is simply the process you start will write something but it's buffered and only at the end of the run the outputFile content can be used... Furthermore to make analysis somehow possible an full working example project would be helpful...
I have the following situation:
- I'm starting (async) a server process which has lots of output on stdout.
- At some point the buffer is full and the process blocks as it no longer can write to stdout
So if I understood you correctly, the implementation only uses a buffer and therefore will not work if more output than has space in the buffer is produced?
Here is a simple example to illustrate the problem. At the end of mvn install, the target/stdout.log file is empty.
I'm having the same issue
Stumbled upon this in 2020 with Version 3.0.0, and did some research. As it is, this might be fixed fairly easy, by using the redirect-methods introduced into the ProcessBuilder with JDK 7 as of 2011. Unfortunately, the exec plugin relies on common-exec, which in turn hasn't been released since 2014, and has last been build maintaining backward compatibility to JDK 1.5.
So the options are: Swapping out commons-exec, or upgrading commons-exec first, in order to expose the methods of JDK 1.7.
By the way: to which degree do we maintain BC for this plugin? JDK 11?