Commit 29afcb78 authored by Biju Kunjummen's avatar Biju Kunjummen Committed by Phillip Webb

Added an @Execute annotation to RunMojo

Update RunMojo to include an @Execute annotation. Allows the use of
`mvn spring-boot:run` without having to compile/package first. Now a
command like `mvn clean spring-boot:run` works.

The phase for @Execute annotation is along the lines of what is used
for the `jetty:run` plugin.
parent 47d0ba5c
...@@ -30,6 +30,7 @@ import org.apache.maven.model.Resource; ...@@ -30,6 +30,7 @@ import org.apache.maven.model.Resource;
import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.Parameter;
...@@ -43,6 +44,7 @@ import org.springframework.boot.loader.tools.MainClassFinder; ...@@ -43,6 +44,7 @@ import org.springframework.boot.loader.tools.MainClassFinder;
* @author Phillip Webb * @author Phillip Webb
*/ */
@Mojo(name = "run", requiresProject = true, defaultPhase = LifecyclePhase.VALIDATE, requiresDependencyResolution = ResolutionScope.TEST) @Mojo(name = "run", requiresProject = true, defaultPhase = LifecyclePhase.VALIDATE, requiresDependencyResolution = ResolutionScope.TEST)
@Execute(phase=LifecyclePhase.TEST_COMPILE)
public class RunMojo extends AbstractMojo { public class RunMojo extends AbstractMojo {
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment