Build such Processor. It will find the MyBuilder in the project. Also need META-INF/services/javax.annotation.processing.Processor to tell compiler what processors it will parse.
Some says to use google AutoService. After some test, it shows AutoService could help to generate META-INF/services/javax.annotation.processing.Processor. However, if existing code uses generated code which is having error, it wouldn't parse successfully. Seems need to rely on the native way.
After mvn compile, can actually see the logs.
Run mvn install, it installs to local .m2
Also can see the MyClassBuilder has been created:
All it needs is just to include below dependency. Unlike many articles says, it doesn't seem need the annotationProcessorPaths stuff.
<dependency>
<groupId>org.example</groupId>
<artifactId>common-lib</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
Can also define your own MyBuilder at places you want in current project.
Can also run the code or compile directly in the project.