Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When source contains jooq generated User Defined Type code, lombok fails to compile #3782

Open
superxiao opened this issue Nov 17, 2024 · 2 comments
Labels
parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these.

Comments

@superxiao
Copy link

Describe the bug
Demo repo
The repository contains code generated by jOOQ. It compiles successfully before adding Lombok. After adding Lombok, the annotations are not recognized, resulting in a compilation error. Adding org.jetbrains:annotations as a dependency resolves the issue.

To Reproduce
Demo repo
Run ./gradlew compileJava. The following compilation errors occur:

> Compilation failed; see the compiler output below.
  error: cannot access ApiStatus
    class file for org.jetbrains.annotations.ApiStatus not found
  /home/xiaojian-wang/lombok-jooq-bug-demo/src/main/java/com/example/DemoApplication.java:21: error: cannot find symbol
                log.info("Person ${}", Person.builder().name("John").build().getName());
                                             ^
    symbol:   method builder()
    location: class Person
  /home/xiaojian-wang/lombok-jooq-bug-demo/src/main/java/com/example/DemoApplication.java:21: error: cannot find symbol
                log.info("Person ${}", Person.builder().name("John").build().getName());
                ^
    symbol:   variable log
    location: class DemoApplication
  3 errors

Adding org.jetbrains:annotations as a dependency fixes the compilation. However, before Lombok is added, the project compiles without needing org.jetbrains:annotations.

Expected behavior
Adding Lombok should not introduce new dependencies that are otherwise not required.

Version info (please complete the following information):

  • Lombok version: 1.18.36
  • Platform: Java, Gradle, Ubuntu latest

Additional context

@Rawi01
Copy link
Collaborator

Rawi01 commented Nov 23, 2024

This seems to be a general problem if you use an annotation processor (like lombok) with jooq. I used your example, replaced the lombok with mapstruct (annotationProcessor("org.mapstruct:mapstruct-processor:1.6.3")), removed the demo code and still get the class file for org.jetbrains.annotations.ApiStatus not found error.

@Rawi01 Rawi01 added the parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these. label Nov 23, 2024
@superxiao
Copy link
Author

Thanks. I will report this issue back to jooq.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these.
Projects
None yet
Development

No branches or pull requests

2 participants