I'm wondering if it is possible to distribute a lombok.config through a parent pom. Let me elaborate. Say I have a parent pom referencing all kind of reusable components among other to be used libraries in dependencyManagement
. Among these libraries is lombok
and it is used by several components. Other projects will set our pom as parent and they have a base to work from. Lombok provides a configuration mechanism by means of a lombok.config
. This is supposed to be set in the project root. At this point I don't see a way to distribute the configuration. How do I achieve this? Or is this impossible or an anti-pattern.
Usually, a user of lombok puts a lombok. config file with their preferences in a workspace or project root directory, with the special config. stopBubbling = true key to tell lombok this is your root directory.
I put lombok. config in the project root directory of my Spring Boot project and it works fine. I put the file under src/main/java ; that fixed the problem.
Project Lombok (from now on, Lombok) is an annotation-based Java library that allows you to reduce boilerplate code. Lombok offers various annotations aimed at replacing Java code that is well known for being boilerplate, repetitive, or tedious to write.
It looks like there is nothing to do this... maybe it would be a nice feature, but for now, the configuration file has to be distribuited manually. However, to me it does not look as an anti-pattern. You are just overwriting the default policy of Lombok with yours, and it is a good practice to centralize this setting in your development infrastructure.
Maybe you should propose this feature to Project Lombok's guys.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With