Closed pc-mzhou closed 2 years ago
One thing I had suspicion of is the computer on which I build my project. I have a newer MacBook Pro (and Apple silicon) than my coworkers who don't experience this issue on their older Macs.
MacBook Pro (14-inch, 2021)
chip: Apple M1 Pro
OS: macOS Monterey version 12.1
When it failed, I found that none of the Lombok annotated methods (getters/setters/builders etc) were generated therefore java compiler could not find those methods when compiling the MapStruct mapper implementations.
If this is the case when it fails then the failure has nothing to do with MapStruct and everything to do with Lombok. I would suggest you to raise an issue about it in the Lombok issue tracker. It could be related to the Java you are using for the Apple silicon.
@filiphr Thanks for the pointers.
We have a Maven-managed Spring Boot project that uses both Lombok and MapStruct, whose pom.xml file follows exactly these instructions laid out here https://mapstruct.org/documentation/stable/reference/html/#_set_up as well as the sample project https://github.com/mapstruct/mapstruct-examples/tree/master/mapstruct-lombok
The build fails from time to time if I execute
mvn clean install -DskipTests
. When it failed, I found that none of the Lombok annotated methods (getters/setters/builders etc) were generated therefore java compiler could not find those methods when compiling the MapStruct mapper implementations. When it succeeded, every Lombok method was generated. What baffled me is that the build will magically work again after a while, without me doing anything. So it's hard to characterize what failed the build.Our related setup:
Here is a snippet of our pom.xml on java compiler plugin