Do Lombok custom extensions require Lombok?

I experimented with adding custom annotations to Lombok. My starting point is the source fork on GitHub.

I added an annotation that works great. I can use the included eclipse launch (or create a jar and change it to my eclipse.ini) to check and see the results: I successfully inserted the method into the class.

Now this only works if I put additional handler classes in the package lombok. If I put them under another package, they just won’t work. I can create a new physical source directory, fine-tune the script construct to include it accordingly, and my new classes will live there if it logically packs new classes under the block.

Why is this? Anyway, around? I would like to highlight any add-ons that I am writing in a new top-level package to distinguish them from the official lombok levels.

+5
source share
1 answer

Due to problems loading classes in Eclipse, Lombok fixes the Equinox class loader to load classes in the lombok package from another location. This is hard-coded. Thus, your extension should also be in the lombok package, or you need to change the code in EclipsePatcher to also include your own package.

Full disclosure: I am one of the developers of the Lombok project.

+3
source

All Articles