IntelliJ IDEA 2020.1 Help

Micronaut

Micronaut is a modern Java framework for writing microservice and serverless applications. IntelliJ IDEA provides coding assistance specific to Micronaut, for example, you can auto-complete Ctrl+Space parameters in application.properties and application.yml files, see quick documentation Ctrl+Q for them, and navigate to their definitions by holding down the Ctrl key. There is also integration with the Bean Validation and Endpoints tool windows.

Run a sample Micronaut application

You can use this sample pet clinic application to get started with Micronaut.

  1. Clone https://github.com/graemerocher/micronaut-petclinic.

    Open File | New | Project from Version Control and specify the URL of the repository.

  2. Run the PostgreSQL Docker container.

    Open docker-compose.yml and click The Run Docker Compose icon in the gutter to run the db service.

    Run Docker Compose service
  3. With the PostreSQL container running, start the application.

    Open PetClinicApplication.java and click The Run icon in the gutter to run the main() method.

    Run Micronaut app main() method

In the Run tool window, you will see that the server initialized on http://localhost:8080. Open this URL in a web browser to see the home page of the PetClinic web server.

The PetClinic home page

You can open the Endpoints tool window (View | Tool Windows | Endpoints) to see all Micronaut HTTP, WebSocket, and built-in management endpoints defined in the Pet Clinic application:

Micronaut Pet Clinic endpoints

Double-click an endpoint to open its definition in the editor. You can also select an endpoint and click The Generate HTTP Request button to generate an HTTP request and then execute it in the built-in HTTP client.

When working with the source code, you can use relevant icons in the gutter for navigation:

Icon

Action

The Navigate to the autowired dependencies icon

Navigate to autowired dependencies

The Navigate to event listeners icon

Navigate to event listeners

The Navigate to event publisher icon

Navigate to event publisher

The Open in HTTP editor icon

Open in HTTP editor

Micronaut gutter icons
Last modified: 15 April 2020