Lombok.config across multi-module maven project

1,291 views
Skip to first unread message

GabrielaElena

unread,
Aug 3, 2020, 11:33:26 AM8/3/20
to Project Lombok
Hi,

I had previously worked in a simple maven project and used lombok to generate boiler-plate code for my models and also implemented unit tests for testing the business logic of the project. I had to configure lombok.config file to ignore some of the annotations in order to have good coverage with "lombok.addLombokGeneratedAnnotation = true". Everything worked fine and I was happy with the results!

One problem came up when we had to divide this project into multiple maven modules. Nothing was changed to the unit tests, as they tested the same logic, only the structure of the project change into 6 different modules with one parent (pom.xml parent). Now the lombok.config file is no longer working as the modules are not aware of this configuration and the coverage dropped a lot. Sonarqube complains that there are getters, setters not tested, but I wanted to ignore those. Is there a way to distribute this configuration across maven modules? 

I tried placing different lombok.config files inside the modules themselves, but this changed nothing.

Waiting for a suggestion, if possible!
Thanks!

Kind regards,
Gabriela

Mat Jaggard

unread,
Aug 3, 2020, 2:33:18 PM8/3/20
to project-lombok
Are you able to view the (de)compiled code to check if the issue is with Lombok rather than with Jacoco or other code coverage tool?

--
You received this message because you are subscribed to the Google Groups "Project Lombok" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-lombo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/project-lombok/b7c9cdab-e8c6-454f-a09e-71b497d65059o%40googlegroups.com.

GabrielaElena

unread,
Aug 4, 2020, 3:21:04 AM8/4/20
to Project Lombok
I'm not sure I'm able to do that, but I'm sure that it comes from lombok because SonarQube directly points to these classes for bad coverage. And as I said, in the past, with the same code but different maven structure, the coverage was really good at 90%.

Mat Jaggard

unread,
Aug 4, 2020, 3:49:07 AM8/4/20
to project-lombok
I don't know for sure but this feels more like a Jacoco problem. Sonarqube does not do code coverage, it presents data from a code coverage tool. Is it possible you've changed version of Jacoco as part of the change of structure? 0.8.0 was the first version to pay attention to code marked with @Generated. I think you should look at the decompiled code (very easy with IntelliJ, not sure about other IDEs) and find a generated method to see if the compiled version contains the @Generated annotation.

On Tue, 4 Aug 2020, 08:21 GabrielaElena, <gabby....@gmail.com> wrote:
I'm not sure I'm able to do that, but I'm sure that it comes from lombok because SonarQube directly points to these classes for bad coverage. And as I said, in the past, with the same code but different maven structure, the coverage was really good at 90%.

--
You received this message because you are subscribed to the Google Groups "Project Lombok" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-lombo...@googlegroups.com.

GabrielaElena

unread,
Aug 4, 2020, 4:35:58 AM8/4/20
to Project Lombok
Ok, thanks a lot for the suggestions! I will definitely look into this and see if it's a Jacoco issue. We are using version 0.8.1, so I'm guessing the versions are good. I just wanted to ask, since we are in this lombok project forum, if we are on the right track with configuring lombok for multi-module maven projects. There is no documentation about this on the website, only on how to configure this for a normal maven project. Maybe it would be useful to add that as well on the official website! Let me know if what I already tried is (placing the configs into the modules separately) is the right thing to do :) 

Thanks! 


marți, 4 august 2020, 10:49:07 UTC+3, Mat Jaggard a scris:
I don't know for sure but this feels more like a Jacoco problem. Sonarqube does not do code coverage, it presents data from a code coverage tool. Is it possible you've changed version of Jacoco as part of the change of structure? 0.8.0 was the first version to pay attention to code marked with @Generated. I think you should look at the decompiled code (very easy with IntelliJ, not sure about other IDEs) and find a generated method to see if the compiled version contains the @Generated annotation.

On Tue, 4 Aug 2020, 08:21 GabrielaElena, <gabby....@gmail.com> wrote:
I'm not sure I'm able to do that, but I'm sure that it comes from lombok because SonarQube directly points to these classes for bad coverage. And as I said, in the past, with the same code but different maven structure, the coverage was really good at 90%.

--
You received this message because you are subscribed to the Google Groups "Project Lombok" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages