Fork me on GitHub

Maven plugin to execute and package Micronaut applications.

This plugin has the following features:

Usage

Add the plugin to your build/plugins section:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <!-- ... -->
    <packaging>${packaging}</packaging>

    <properties>
        <!-- ... -->
        <packaging>jar</packaging>
        <micronaut.runtime>netty</micronaut.runtime>
    </properties>

    <build>
        <plugins>
            <!-- ... -->

            <plugin>
                <groupId>io.micronaut.maven</groupId>
                <artifactId>micronaut-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
Since version 4.0.0 of this plugin (which is the version compatible with Micronaut 4.x), the group id is io.micronaut.maven. Earlier versions compatible with Micronaut 3.x used io.micronaut.build.

The <packaging> part is important since the plugin support several packaging types. The default is jar.

For snapshot versions, you need the Sonatype OSSRH Snapshot repository:

<project>

    <!-- ... -->

    <pluginRepositories>

        <!-- ... -->

        <pluginRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</project>