diff --git a/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java b/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java index f25e099b..a621d1d2 100644 --- a/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java +++ b/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java @@ -545,6 +545,10 @@ protected CompilerResult compileOutOfProcess(CompilerConfiguration config, Strin try { returnCode = CommandLineUtils.executeCommandLine(cli, out, out); + if (getLog().isDebugEnabled()) { + getLog().debug("Compiler output:{}{}", EOL, out.getOutput()); + } + messages = parseModernStream(returnCode, new BufferedReader(new StringReader(out.getOutput()))); } catch (CommandLineException | IOException e) { throw new CompilerException("Error while executing the external compiler.", e); @@ -587,7 +591,7 @@ protected CompilerResult compileInProcessWithProperClassloader(Class javacCla /** * Helper method for compileInProcess() */ - private static CompilerResult compileInProcess0(Class javacClass, String[] args) throws CompilerException { + private CompilerResult compileInProcess0(Class javacClass, String[] args) throws CompilerException { StringWriter out = new StringWriter(); Integer ok; @@ -599,6 +603,10 @@ private static CompilerResult compileInProcess0(Class javacClass, String[] ar ok = (Integer) compile.invoke(null, new Object[] {args, new PrintWriter(out)}); + if (getLog().isDebugEnabled()) { + getLog().debug("Compiler output:{}{}", EOL, out.toString()); + } + messages = parseModernStream(ok, new BufferedReader(new StringReader(out.toString()))); } catch (NoSuchMethodException | IOException | InvocationTargetException | IllegalAccessException e) { throw new CompilerException("Error while executing the compiler.", e);