Class RunMojo

All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="run", requiresDependencyResolution=COMPILE_PLUS_RUNTIME, defaultPhase=PREPARE_PACKAGE, aggregator=true) @Execute(phase=PROCESS_CLASSES) public class RunMojo extends AbstractTestResourcesMojo

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.

Since:
1.0.0
Author:
Álvaro Sánchez-Mariscal
  • Field Details

  • Constructor Details

    • RunMojo

      @Inject public RunMojo(org.apache.maven.execution.MavenSession mavenSession, org.apache.maven.plugin.BuildPluginManager pluginManager, org.apache.maven.project.ProjectBuilder projectBuilder, org.apache.maven.toolchain.ToolchainManager toolchainManager, CompilerService compilerService, ExecutorService executorService, DependencyResolutionService dependencyResolutionService)
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • initialize

      protected final void initialize()
    • setWatches

      protected final void setWatches(List<org.apache.maven.model.FileSet> watches)
    • runApplication

      protected void runApplication() throws Exception
      Runs or restarts the application. Only visible for testing, shouldn't be called directly.
      Throws:
      Exception - if something goes wrong while starting the application