-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Document how to use Lombok with Micronaut #218
Comments
I don't know what is different regarding what
Does this work for you? |
Hi Graeme, I still get the same error, in fact what the plugin does is adding the dependencies as |
Seems if you define: compileOnly 'org.projectlombok:lombok:1.16.20'
annotationProcessor "org.projectlombok:lombok:1.16.20" Before annotationProcessor "io.micronaut:inject-java" Your example compiles. This does however seem fragile to me. |
Yes, it works now! I tried a few combinations around the order of the dependencies but obviously didn't try this one, thanks for that. Agree, it's a good workaround by now but fragile indeed. |
In maven, I had to add lombok processor to pom file explicitly and before micronaut processor <annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.0</version>
</path>
<path>
<groupId>io.micronaut</groupId>
<artifactId>inject-java</artifactId>
<version>${micronaut.version}</version>
</path>
</annotationProcessorPaths> |
I ran into these issues trying to debug using IntelliJ IDEA. I had to add lombok as a "compile" dependency for it to work. not sure exactly why it wouldn't run with lombok as "compileonly" but it didnt. thought I'd share in case anyone else runs into the same issue |
Same problem occur when you use lombok as gradle plugin: but resolve when you remove "io.freefair.lombok" as plugin and add in dependency as suggested above by @graemerocher . Thanks Manav |
@rubensyltek's solution works, but it must be |
For those who are still experiencing this issue: try |
I tried to use Micronaut with Lombok and there seems to be some kind of conflict between the annotation processing and compile-time tasks that Micronaut executes to process DI and the class metadata, and the annotation processing that Lombok does.
Task List
Steps to Reproduce
@Data
or other annotation from LombokAn important point to highlight is that if I don't use annotations on the Controller, the build is successful (as it doesn't generate all the metadata classes).
Expected Behaviour
Compile successful
Actual Behaviour
Compile error: symbol not found
Environment Information
Example Application
build.gradle
GreetingDto.java
GreetingController.java
Console output
The text was updated successfully, but these errors were encountered: