plexus-compiler icon indicating copy to clipboard operation
plexus-compiler copied to clipboard

Write raw javac output to a log file

Open mensinda opened this issue 2 years ago • 4 comments

Sometimes it is useful to look at the raw javac output when running in fork mode.

With this PR, the raw javac logs will be written to target/compiler-logs/javac_*.log

mensinda avatar Jul 06 '23 10:07 mensinda

maybe it would be better as optional. when debug is activated?

olamy avatar Sep 13 '23 03:09 olamy

Making this optional would be fine, but I would not use any existing CompilerConfiguration, since my use case is easily inspecting the raw compiler output with the current configuration (well, CompilerConfiguration#isVerbose could work...). However, I also don't think that adding a new option to the CompilerConfiguration is a good idea, since (currently) only a specific usage of the javac compiler is supported.

Maybe this could be controlled with a system property?

mensinda avatar Sep 22 '23 13:09 mensinda

Hi, with 7cc5d404ec7948f5d4603ef6e548454c39e68a01 we will have the output logged

slachiewicz avatar Dec 25 '24 21:12 slachiewicz

Hi, writing the full log with with debug enabled does help somewhat, but is not enough for our use-case:

If I understand this correctly, the debug log would only trigger with mvn -X. While this would show the full compiler log, searching for it would be similar to searching for a needle in a haystack, since mvn -X is very verbose. In some projects, the output even exceeds the (default) scrollback line limit of most terminals.

Always, having the complete log in a separate file is, without having to recompile with different flags, is much easier to deal with. Especially in an organization, where not everyone has in-depth knowledge of the build tools.

Thus, I would prefer a solution where the logs are always written or at least configurable company wide with our parent POM.

mensinda avatar Feb 19 '25 08:02 mensinda