问题
I am using Lombok in IntelliJ. Though everything else is working fine when I try to do the static import of the Lombok builder, IntelliJ build project doesn't find the builder class. If you don't use static import, it works fine.
回答1:
This is a known bug, and not something that's easy to fix. Static imports are resolved before the annotation processors are run. This is a problem in javac, not lombok.
Disclosure: I am a lombok developer.
回答2:
I ran into this error, after I added the lombok dependancy.
I solved this by:
1. Installing the intellij lombok plugin.
2. Enabling annotation processing at "Settings > Build > Compiler > Annotation Processors"
3. Restart IDE.
来源:https://stackoverflow.com/questions/47674264/static-import-not-working-in-lombok-builder-in-intellij