- How to debug Java compiler & Annotation processor
- Enable
Debug Build Process - File | Settings | Build, Execution, Deployment | Build Tools | Gradle
- Build and run using:
IDEA
- Build and run using:
- File | Settings | Build, Execution, Deployment | Compiler | Annotation Processors
- Enable Annotation Processor
- Create debug configuration
- Remote JVM Debug
- Name/Label: Use something like
Debug Java compiler
- Add breakpoint in annotation processor
- eg.
lombok.launch.AnnotationProcessorHider.AnnotationProcessor::init
- eg.
- Build (
CTRL+F9)- The console shows a message like:
Executing pre-compile tasks…
Build: waiting for debugger connection on port 44355