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.
This commit is contained in:
Biju Kunjummen 2013-08-25 10:29:28 -04:00 committed by Phillip Webb
parent 47d0ba5c8e
commit 29afcb7898
1 changed files with 2 additions and 0 deletions

View File

@ -30,6 +30,7 @@ import org.apache.maven.model.Resource;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
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.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
@ -43,6 +44,7 @@ import org.springframework.boot.loader.tools.MainClassFinder;
* @author Phillip Webb
*/
@Mojo(name = "run", requiresProject = true, defaultPhase = LifecyclePhase.VALIDATE, requiresDependencyResolution = ResolutionScope.TEST)
@Execute(phase=LifecyclePhase.TEST_COMPILE)
public class RunMojo extends AbstractMojo {
/**