17.1 Creating a Project

Creating a project is the primary usage of the CLI. The primary command for creating a new project is create-app, which creates a standard server application that communicates over HTTP. For other types of application, see the documentation below.

Table 1. Micronaut CLI Project Creation Commands
CommandDescriptionOptionsExample

create-app

Creates a basic Micronaut application.

  • -l, —lang

  • -t, —test

  • -b, —build

  • -f, —features

  • -i, —inplace

  1. mn create-app my-project features
  2. mongo-reactive,security-jwt build maven

create-cli-app

Creates a command-line Micronaut application.

  • -l, —lang

  • -t, —test

  • -b, —build

  • -f, —features

  • -i, —inplace

  1. mn create-cli-app my-project features
  2. http-client,jdbc-hikari build maven
  3. lang kotlin test kotest

create-function-app

Creates a Micronaut serverless function, using AWS by default.

  • -l, —lang

  • -t, —test

  • -b, —build

  • -f, —features

  • -i, —inplace

  1. mn create-function-app my-lambda-function
  2. lang groovy test spock

create-messaging-app

Creates a Micronaut application that only communicates via a messaging protocol. Uses Kafka by default but can be switched to RabbitMQ with —features rabbitmq.

  • -l, —lang

  • -t, —test

  • -b, —build

  • -f, —features

  • -i, —inplace

  1. mn create-messaging-app my-broker
  2. lang groovy test spock

create-grpc-app

Creates a Micronaut application that uses gRPC.

  • -l, —lang

  • -t, —test

  • -b, —build

  • -f, —features

  • -i, —inplace

  1. mn create-grpc-app my-grpc-app
  2. lang groovy test spock