I'm trying to learn how to make a custom annotation processor and I'm stuck with trying to debug it.
I have already managed to run the javac compiler in debug mode (with mvnDebug clean install) (with someone else's project with an annotation processor), connect to it with IntelliJ IDEA and have it stop at breakpoints in the annotation processor.
If we have something like this in some package in our project, being just like any other class (eg. no special configuration or anything):
public class MyProcessor extends AbstractProcessor {...}
Can we somehow hook it into the build process of maven as an annotation processor? So that it is compiled first, then the whole project is compiled with the annotation processor active.
Also, as far as I know, annotation processors require some kind of META INF file, which can be generated with something like google autoservices annotation processor.
So maybe a maven build process where we have autoservices run first, then the class extending the AbstractProcessor compiled as an annotation processor and finally have the whole project compile with our own annotation processor active (and with the javac compiler in debug mode).