Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Distribute lombok.config

Tags:

java

maven

lombok

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.

like image 363
pjanssen Avatar asked Aug 03 '18 06:08

pjanssen


People also ask

Where should I put Lombok config?

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.

Where does Lombok config go in spring boot?

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.

What are Lombok annotations?

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.


1 Answers

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.

like image 72
Lorelorelore Avatar answered Sep 20 '22 01:09

Lorelorelore