Does anyone know how to configure the Eclipse IDE to use the micronaut-inject-java annotation processor? I have a Gradle build file that specifies the micronaut annotation processors, and my unit tests run correctly in Gradle; but not when I run tests through Eclipse.
I've tried configuring the properties for my project to tell the IDE to use the annotation processors in my Gradle cache:
But when I run tests through the JUnit Eclipse plug-in, I always get the following message:
Failed to evaluate condition [io.micronaut.test.extensions.junit5.MicronautJunit5Extension]: @MicronautTest used on test but no bean definition for the test present. This error indicates a misconfigured build or IDE. Please add the 'micronaut-inject-java' annotation processor to your test processor path (for Java this is the testAnnotationProcessor scope, for Kotlin kaptTest and for Groovy testCompile). See the documentation for reference: https://micronaut-projects.github.io/micronaut-test/latest/guide/
Today, we were able to resolve this by upgrading to Gradle 6.5.1. Upon running the gradle eclipse task after the upgrade, then the @MicronautTest annotation works properly, dependency injection works, and generation of client code works.
It's worth noting that we only run our unit tests through the Gradle Buildship plugin now, and we do not use the Junit Eclipse plugin at all. It's nice that we can also debug with Buildship and Gradle 6.5.1, which is an option that was not available to us on the earlier Gradle version that we were using.