Package org.springframework.boot.maven
Class RunMojo
- java.lang.Object
- org.apache.maven.plugin.AbstractMojo
- org.springframework.boot.maven.AbstractDependencyFilterMojo
- org.springframework.boot.maven.AbstractRunMojo
- org.springframework.boot.maven.RunMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="run", requiresProject=true, defaultPhase=VALIDATE, requiresDependencyResolution=TEST) @Execute(phase=TEST_COMPILE) public class RunMojo extends AbstractRunMojo
Run an executable archive application.
Constructor Summary
Constructors Constructor Description RunMojo()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
enableForkByDefault()
Specify if fork should be enabled by default.protected void
logDisabledFork()
Log a warning indicating that fork mode has been explicitly disabled while some conditions are present that require to enable it.protected void
runWithForkedJvm(File workingDirectory, List<String> args, Map<String,String> environmentVariables)
Run with a forked VM, using the specified command line arguments.protected void
runWithMavenJvm(String startClassName, String... arguments)
Run with the current VM, using the specified arguments.Methods inherited from class org.springframework.boot.maven.AbstractRunMojo
execute, getClassPathUrls, isFork, resolveApplicationArguments, resolveEnvVariables, resolveJvmArguments
Methods inherited from class org.springframework.boot.maven.AbstractDependencyFilterMojo
filterDependencies, getFilters, setExcludeGroupIds, setExcludes, setIncludes
Constructor Detail
RunMojo
public RunMojo()
Method Detail
enableForkByDefault
protected boolean enableForkByDefault()
Description copied from class:AbstractRunMojo
Specify if fork should be enabled by default.- Overrides:
enableForkByDefault
in classAbstractRunMojo
- Returns:
true
if fork should be enabled by default- See Also:
AbstractRunMojo.logDisabledFork()
logDisabledFork
protected void logDisabledFork()
Description copied from class:AbstractRunMojo
Log a warning indicating that fork mode has been explicitly disabled while some conditions are present that require to enable it.- Overrides:
logDisabledFork
in classAbstractRunMojo
- See Also:
AbstractRunMojo.enableForkByDefault()
runWithForkedJvm
protected void runWithForkedJvm(File workingDirectory, List<String> args, Map<String,String> environmentVariables) throws org.apache.maven.plugin.MojoExecutionException
Description copied from class:AbstractRunMojo
Run with a forked VM, using the specified command line arguments.- Specified by:
runWithForkedJvm
in classAbstractRunMojo
- Parameters:
workingDirectory
- the working directory of the forked JVMargs
- the arguments (JVM arguments and application arguments)environmentVariables
- the environment variables- Throws:
org.apache.maven.plugin.MojoExecutionException
- in case of MOJO execution errors
runWithMavenJvm
protected void runWithMavenJvm(String startClassName, String... arguments) throws org.apache.maven.plugin.MojoExecutionException
Description copied from class:AbstractRunMojo
Run with the current VM, using the specified arguments.- Specified by:
runWithMavenJvm
in classAbstractRunMojo
- Parameters:
startClassName
- the class to runarguments
- the class arguments- Throws:
org.apache.maven.plugin.MojoExecutionException
- in case of MOJO execution errors