Imagine the following:
@MyAnnotation
public class A { ... };
@MyOtherAnnotation
public class B { ... };
If a class is annotated with @MyAnnotation, an extra @MyExtraAnnotation should be added before annotation processing. So, after that step, we should have:
@MyExtraAnnotation
@MyAnnotation
public class A { ... };
@MyOtherAnnotation
public class B { ... };
Is this possible? If yes how? Thanks.
You should look at the
process-sourcesphase of the lifecycle, or possibly theannotationProcessorsconfiguration of the maven compiler plugin.I’ve not found a plugin that “adds annotations”, but is certainly should be possible to create one to do just that.