External annotation processor not working

21 views Asked by At

I'm trying to use Jilt in several projects. Since I'm using the same builder annotation in all of them, I thought it would be a good idea to do a custom annotation in a common library which could be used then wherever necessary. The common library is jilt-common. For testing purposes, I've created also a project which imports this library: jilt-test.

Well, Jilt does not seem to work this way. First thing I saw is @Builder and @BuilderInterfaces retention policies (SOURCE) prevent those annotations to remain in the compiled source, so when jilt-test uses jilt-common builder annotation, it is not a jilt builder anymore. So I forked the repository and added CLASS retention policy for both annotations. You can check it here: common-test. With this change, annotations are preserved, but processor is still ignoring them.

I don't really know what else to do. It somehow makes sense for me that this does not work, since jilt-test only uses already compiled classes of jilt-common, so I guess the processors are obviously ignoring that. But I also guess there must be some way to make this work.

0

There are 0 answers