Package org.springframework.boot.maven
Class StartMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.springframework.boot.maven.AbstractDependencyFilterMojo
org.springframework.boot.maven.AbstractRunMojo
org.springframework.boot.maven.AbstractApplicationRunMojo
org.springframework.boot.maven.StartMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="start",
requiresProject=true,
defaultPhase=PRE_INTEGRATION_TEST,
requiresDependencyResolution=TEST)
public class StartMojo
extends AbstractApplicationRunMojo
Start a spring application. Contrary to the
run
goal, this does not block and
allows other goals to operate on the application. This goal is typically used in
integration test scenario where the application is started before a test suite and
stopped after.- Since:
- 1.3.0
- Author:
- Stephane Nicoll
- See Also:
-
Field Summary
Fields inherited from class org.springframework.boot.maven.AbstractRunMojo
classesDirectory, project
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
Execute a task, retrying it on failure.protected org.springframework.boot.maven.RunArguments
Resolve the application arguments to use.protected org.springframework.boot.maven.RunArguments
Resolve the JVM arguments to use.protected void
Run with a forked VM, using the specified command line arguments.Methods inherited from class org.springframework.boot.maven.AbstractApplicationRunMojo
getClassPathUrls, run
Methods inherited from class org.springframework.boot.maven.AbstractRunMojo
addArgs, addClasspath, addDependencies, addJvmArgs, addProjectClasses, addUserDefinedDirectories, execute, getJavaExecutable, getStartClass, hasTerminatedSuccessfully, resolveEnvVariables
Methods inherited from class org.springframework.boot.maven.AbstractDependencyFilterMojo
filterDependencies, getFilters, setExcludeGroupIds, setExcludes, setIncludes
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
StartMojo
public StartMojo()
-
-
Method Details
-
run
protected void run(File workingDirectory, List<String> args, Map<String, String> environmentVariables) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionDescription copied from class:AbstractApplicationRunMojo
Run with a forked VM, using the specified command line arguments.- Specified by:
run
in classAbstractApplicationRunMojo
- 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 errorsorg.apache.maven.plugin.MojoFailureException
- in case of MOJO failures
-
resolveApplicationArguments
protected org.springframework.boot.maven.RunArguments resolveApplicationArguments()Description copied from class:AbstractRunMojo
Resolve the application arguments to use.- Overrides:
resolveApplicationArguments
in classAbstractRunMojo
- Returns:
- a
RunArguments
defining the application arguments
-
resolveJvmArguments
protected org.springframework.boot.maven.RunArguments resolveJvmArguments()Description copied from class:AbstractRunMojo
Resolve the JVM arguments to use.- Overrides:
resolveJvmArguments
in classAbstractRunMojo
- Returns:
- a
RunArguments
defining the JVM arguments
-
execute
Execute a task, retrying it on failure.- Type Parameters:
T
- the result type- Parameters:
wait
- the wait timemaxAttempts
- the maximum number of attemptscallback
- the task to execute (possibly multiple times). The callback should returnnull
to indicate that another attempt should be made- Returns:
- the result
- Throws:
Exception
- in case of execution errors
-