Maven plugin to execute and package Micronaut applications.

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.


Add the plugin to your build/plugins section:


    <!-- ... -->


            <!-- ... -->


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


    <!-- ... -->


        <!-- ... -->


Then, you can use mn:run to run your application in development mode:

$ mvn clean mn:run

[INFO] Scanning for projects...
[INFO] -----------------< java.maven.junit:java-maven-junit >------------------
[INFO] Building java-maven-junit 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ java-maven-junit ---
[INFO] Deleting /Users/alvarosanchez/Micronaut/micronaut-maven-plugin/examples/java/target
[INFO] --- micronaut-maven-plugin:1.0.0.BUILD-SNAPSHOT:run (default-cli) @ java-maven-junit ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/alvarosanchez/Micronaut/micronaut-maven-plugin/examples/java/target/classes
13:36:32.665 [main] INFO  io.micronaut.runtime.Micronaut - Startup completed in 919ms. Server Running: http://localhost:8080

Other options

  • Running in debug mode: mvn mn:run -Dmn.debug.

  • Changing the debugger port: mvn mn:run -Dmn.debug -Dmn.debug.port=5006.

  • Suspending the debugger execution: mn:run -Dmn.debug -Dmn.debug.suspend.


  • mn:run: executes a Micronaut application in development mode.