Micronaut 1.1 - Challenges with IntelliJ IDEA

Micronaut version 1.1 RC2 is the latest as of writing this post.

One of my previous post describes how to create a service in Micronaut. That post was created using version 1.0.5. I was pleasantly surprised to see JUnit 5 as the default test framework for Java in Micronaut 1.1.

Everything worked well from the command line. However running from the IntelliJ IDEA did not work as expected. The test case was failing. The application was running from the IDE, but was producing 404 error when the endpoint was invoked.

You need to have enabled the 'Annotation Process' feature to be able run Micronaut from IDEA, which I had already done.

Solution 1

I checked the 'Delegate IDE build/run actions to gradle' option. With this I was able to run the tests as well the run application.

Solution 2

When I had originally imported the project into my IntelliJ IDEA, i had opted to use local gradle distribution. Now I tried switching to gradle wrapper, which was also solving the problem.

I came across some discussions on the gaps in supporting newer dependency configuration options.