Micronaut

Last modified: 01 August 2022

Required plugin: Micronaut (bundled)

Micronaut is a modern Java framework for writing microservice and serverless applications. IntelliJ IDEA provides the following:

  • Coding assistance specific to the Micronaut API and the configuration file parameters. For example, when writing query methods, generating HTTP requests for defined endpoints, and so on.

  • Integration with the Bean Validation and Endpoints tool windows.

  • A dedicated project creation wizard based on launch.micronaut.io.

  • A dedicated run configuration for Micronaut applications.

The generated project contains only the main Application class and everything necessary to run the application. IntelliJ IDEA recognizes it and adds the Run icon to the gutter, which you can click to run the application.

The default Micronaut application main class

However, an empty project is boring. Let's make the application return Hello World! in response to an HTTP GET request.

IntelliJ IDEA recognizes the HTTP controller and marks it with The HTTP Controller icon in the gutter. You can also click The Open in HTTP Client icon to generate an HTTP request for the endpoint and open it in a separate HTTP client editor tab. IntelliJ IDEA provides other gutter icons, for example:

  • The Navigate to event listeners icon Navigate to event listeners

  • The Navigate to event publisher icon Navigate to event publisher

  • The Navigate to the autowired dependencies icon Navigate to the autowired dependencies

To see all the endpoints defined in your application, open the Endpoints tool window. For example, here is the /hello endpoint:

The Endpoints tool window with the sample /hello endpoint