Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: In debug mode, print full output of Java Compiler (including stdout) #149

Open
msridhar opened this issue Sep 7, 2021 · 4 comments · May be fixed by #296
Open

Feature request: In debug mode, print full output of Java Compiler (including stdout) #149

msridhar opened this issue Sep 7, 2021 · 4 comments · May be fixed by #296

Comments

@msridhar
Copy link

msridhar commented Sep 7, 2021

I first reported this issue on the Maven Compiler Plugin (https://issues.apache.org/jira/browse/MCOMPILER-407) and it was suggested that the fix needs to happen here first.

Certain Java annotation processors and compiler plugins like The Checker Framework can print useful diagnostics on stdout.  Currently, there is no way to see this output using the Maven Compiler Plugin, even when Maven is run with the -X option.  I suggest that when Maven is in debug mode, there should be a debug message printed with the full stdout of the Java compiler.  This should also work if the compiler is forked.

If someone points me at the relevant code, I am happy to try to submit a pull request for this change.

@rfscholte
Copy link
Member

Start having a look at https://github.com/codehaus-plexus/plexus-compiler/blob/master/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java#L593-L633 (commandline) and https://github.com/codehaus-plexus/plexus-compiler/blob/master/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavaxToolsCompiler.java#L133-L178 (javax tools)
Especially commandline is very tricky, because the output has changed over the years, but we need consistent output.

@urld
Copy link

urld commented Feb 28, 2022

There is a similiar issue #66 where errors are not printed when running javac in forked mode.

@msridhar
Copy link
Author

Unfortunately I haven't had time to look at this, and may not for a while. If I get time to work on it I will comment here

@olamy
Copy link
Member

olamy commented Jul 28, 2022

duplicate with #39

@jaredstehler jaredstehler linked a pull request Jun 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants