GraalVM Tools for Micronaut Extension
The extension also enables the Micronaut Launch application that allows you to create Micronaut projects through an interface inside VS Code, in addition to using the console CLI.
There are, of course, other ways to create a new Micronaut application. If you provide a path to the Micronaut CLI installation, you can create a project using the
In combination with the GraalVM Tools for Java extension, you can run Micronaut projects on GraalVM, and debug them directly from the VS Code development environment with different debugging protocols enabled with the extension. This extension for Micronaut was also developed to help developers build native images right from VS Code.
Table of contents
Installation and Setup
Install the GraalVM Tools for Micronaut extension from the VS Code consolde by clicking on the Extensions icon in the Activity Bar (or invoke it with Ctrl+Shift+X). Search for "Micronaut" and install the package. Reload will be required.
When installed, the extension might check whether there is a registered GraalVM instance, and eventually request to download it or point to a local installation (see GraalVM Installation and Setup in VS Code).
Upon installation, the Micronaut Tools Page window opens, which provides you with shortcuts to:
The GraalVM Tools for Micronaut extension provides:
Micronaut VS Code Commands
To begin, invoke the Micronaut commands from View > Command Palette (Command Palette can be also opened by pressing F1, or the Ctrl+Shift+P hot keys combination for Linux, and Command+Shift+P for macOS):
The following commands are available for Micronaut project development:
This extension contributes the following settings:
Create Micronaut Project
The Create Micronaut Project command in VS Code supports generating Micronaut applications, CLI applications, and other types of applications that a regular Micronaut Launch application does. The wizard prompts users to:
Finally, you are asked to select the destination folder on your local disk and whether to open the created project in a new editor or add it to the current workspace.
The GUI part of the Micronaut extension adds a new view to the Explorer activity, which shows Micronaut projects in the current workspace.
Generate Native Images of Micronaut Projects
The Micronaut support for VS Code is integrated with GraalVM to get the most from the applications and provide you with rich Native Image capabilities.
Having set up GraalVM as the default runtime and debug environment in VS Code, invoke the "View > Command Palette > Micronaut: Build..." action, where you can select the build targets (e.g.,
For more details, continue reading to the Micronaut documentation.
Deploy Micronaut Projects
The Micronaut support in VSCode also allows to build and deploy Docker image to docker registry. Use action View > Command Palette > Micronaut: Deploy... and select dockerPush to deploy dockerized Micronaut application or dockerPushNative to build and push docker with a native executable of Micronaut application.
Besides that, you can also push a Micronaut application or a native executable to the Docker Registry from the VS Code terminal window. A particular Docker Registry can be configured in the build, see the Micronaut Deploying Application documentation.
The GraalVM Tools for Micronaut Extension extension 0.5.* is Technology Preview, meaning the functionality may not be complete.