Fork me on GitHub

Plugin Documentation

Goals available for this plugin:

Goal Description
mn:aot-analysis

Invokes the Micronaut AOT optimizer, generating sources/classes and the effective AOT configuration properties file. Refer to the Micronaut AOT documentation for more information.

WARNING: this goal is not intended to be executed directly. Instead, enable AOT with the micronaut.aot.enabled property, eg:

mvn -Dmicronaut.aot.enabled=true package
mvn -Dmicronaut.aot.enabled=true mn:run
mn:aot-sample-config Generates a sample aot.properties showcasing all the possible values along with a description.
mn:docker

Allows using a provided Dockerfile.

WARNING: this goal is not intended to be executed directly. Instead, specify the packaging type using the packaging property, eg:

mvn package -Dpackaging=docker
mn:docker-crac

Implementation of the docker-crac packaging.

WARNING: this goal is not intended to be executed directly. Instead, specify the packaging type using the packaging property, eg:

mvn package -Dpackaging=docker-crac

This is a two stage process. First a docker image is built that runs the application under a CRaC enabled JDK. Then the application is warmed up via a shell script. And then a checkpoint is taken via a signal using jcmd.

The second stage takes this checkpoint, and creates the final image containing it plus a run script which passes the correct flags to the CRaC enabled JDK.

mn:docker-native

Implementation of the docker-native packaging.

WARNING: this goal is not intended to be executed directly. Instead, specify the packaging type using the packaging property, eg:

mvn package -Dpackaging=docker-native
mn:docker-push

Implementation of the deploy lifecycle for pushing Docker images

WARNING: this goal is not intended to be executed directly. Instead, Execute the deploy phase specifying the packaging type, eg:

mvn deploy -Dpackaging=docker-native
mn:dockerfile

Generates a Dockerfile depending on the packaging and micronaut.runtime properties.

mvn mn:dockerfile -Dpackaging=docker-native -Dmicronaut.runtime=lambda
mn:graalvm-resources

Generate GraalVM resources-config.json with all the resources included in the application

WARNING: this goal is not intended to be executed directly.

mn:help Display help information on micronaut-maven-plugin.
Call mvn mn:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
mn:run

Executes a Micronaut application in development mode.

It watches for changes in the project tree. If there are changes in the pom.xml file, dependencies will be reloaded. If the changes are anywhere underneath src/main, it will recompile the project and restart the application.

The plugin can handle changes in all the languages supported by Micronaut: Java, Kotlin and Groovy.

mn:start-testresources-service Starts the Micronaut test resources server.
mn:stop-testresources-service Stops the Micronaut test resources server.

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 3.3.9
JDK 1.8

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>io.micronaut.build</groupId>
          <artifactId>micronaut-maven-plugin</artifactId>
          <version>3.5.1</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>io.micronaut.build</groupId>
        <artifactId>micronaut-maven-plugin</artifactId>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"