Open jmax01 opened 3 years ago
Was able to reproduce with @Builder instead of @SuperBuilder.
Possible fix is updating MapStruct to 1.5.0.Beta2.
Had a similar issue in a Spring Boot application, but it would fail with lombok 1.18.20. Seems like an issue with lombok-mapstruct integration or mapstruct alone.
Sounds like we can probably just close this issue? I'm not sure we can meaningfully contribute something in the line of a fix; whatever v1.5.0.beta2 is doing that makes this problem go away, that'll be the stable release sooner than we can research this bug.
Sounds like we can probably just close this issue? I'm not sure we can meaningfully contribute something in the line of a fix; whatever v1.5.0.beta2 is doing that makes this problem go away, that'll be the stable release sooner than we can research this bug.
I really think this is a lombok issue as I have encountered the same problem without mapstruct in 1.18.20.
In the example below if we directly import MyEntityBuilder the javadoc generation fails:
//Javadoc generation fails
import MyEntity.MyEntityBuilder;
private MyEntity handleSameState(
final MyEntity existingMyEntity,
final MyEntityUpdateRequest myEntityUpdateRequest) {
return myEntityUpdateRequest.notes()
.map(existingMyEntity.toBuilder()::notes)
.map(MyEntityBuilder::build)
.map(myEntity.Repository()::save)
.orElse(existingMyEntity);
}
If we reference MyEntityBuilder via MyEntity javadoc succeeds.
//Javadoc generation succeeds
private MyEntity handleSameState(
final MyEntity existingMyEntity,
final MyEntityUpdateRequest myEntityUpdateRequest) {
return myEntityUpdateRequest.notes()
.map(existingMyEntity.toBuilder()::notes)
.map(MyEntity.MyEntityBuilder::build)
.map(myEntity.Repository()::save)
.orElse(existingMyEntity);
}
This does not effect all examples of direct Builder imports (at least in 1.18.20) as mapstruct generated code is properly handled even though it has direct Builder imports.
The workaround for this is to add explicit public static class *Builder {}
to each affected class.
Still fails in 1.18.24
Yes, it works just for @Builder, @SuperBuider I can't do it.
It doesn't work on @Builder in 1.18.24
Did someone figure out how to make it work? I still got the same error. Tried updating the versions of lombok and delombok, and adding this public static class *Builder {} to the code. Neither worked. Any suggestion is much appreciated.
In 1.18.22
@SuperBuilder
+mapstruct
causesjavadoc
generation to fail.Generation works fine in 1.18.20 but if one switches to .22:
To Reproduce
With the artifacts below run
mvn clean install
:Test Class:
lombok.config:
pom:
Expected behavior Javadoc generation should not fail.
Version info (please complete the following information):