Consider providing a com.sun.source.util.Plugin?
See original GitHub issueI recently became aware of ErrorProne as @davido is working to integrate it into Buck. Glancing at the code, it looks like the key reason for exposing it as a compiler is to get a TaskListener
into place, which is exactly what the Plugin facility lets you do in javac
8 and higher. Plugin
s can be auto-discovered on the processor path (just like annotation processors), which would make it more straightforward to run ErrorProne even with command-line javac
, and of course any build system that supports Plugin
s (I’m working to add such support to Buck) would no longer require a special integration.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Plugin (Compiler Tree API ) - Oracle Help Center
The javac plug-in mechanism allows a user to specify one or more plug-ins on the javac command line, to be started soon after...
Read more >java - Javac - plugin not found - Stack Overflow
"To achieve this, we need to create a file named com.sun.source.util.Plugin with content which is our plugin's fully qualified class name ...
Read more >The Java Plugin - Gradle User Manual
The Java plugin adds a number of tasks to your project, as shown below. ... Compiles production Java source files using the JDK...
Read more >Processing Code - OpenJDK
The Annotation Processing API, providing a way to execute code within javac that could analyze the classes ... DocTreeScanner; import com.sun.source.util.
Read more >Transition from Java 8 to Java 11 - Azure - Microsoft Learn
There are jdeps and jdeprscan plugins for both Gradle and Maven. ... Util class is calling a deprecated constructor of the java.lang.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@cushon, I’m getting a following stack trace when using
modern
ant compiler with-processorpath
pointing aterror_prone_ant-2.2.0.jar
and-Xplugin:ErrorProne
:I’m I doing something obviously wrong? Is
-J-Xbootclasspath/p:javac-9-dev-r3297-4.jar
required for using ErrorProne plugin? I’m usingjava version "1.8.0_144"
I can reproduce:
The
-Xplugin
integration doesn’t work with JDK 8.It does work with JDK 9:
And it also works if you override JDK 8’s javac with the Error Prone javac:
@tbroyer is there a way to make gradle do the equivalent of overriding the host JDK’s javac using
-J-Xbootclasspath/p:javac-9+181-r4173-1.jar
?