Class AbstractRunMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.springframework.boot.maven.AbstractDependencyFilterMojo
org.springframework.boot.maven.AbstractRunMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
RunMojo, StartMojo, TestRunMojo
Base class to run a Spring Boot application.
- Since:
- 1.3.0
- Author:
- Phillip Webb, Stephane Nicoll, David Liu, Daniel Young, Dmytro Nosan, Moritz Halbritter
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractDependencyFilterMojo
AbstractDependencyFilterMojo.ExcludeTestScopeArtifactFilter, AbstractDependencyFilterMojo.RuntimeArtifactFilter -
Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractRunMojo(org.apache.maven.toolchain.ToolchainManager toolchainManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Returns the directories that contain the application's classes and resources.protected URL[]protected abstract booleanprotected org.springframework.boot.maven.RunArgumentsResolve the application arguments to use.protected org.springframework.boot.maven.EnvVariablesResolve the environment variables to use.protected org.springframework.boot.maven.RunArgumentsResolve the JVM arguments to use.protected abstract voidrun(org.springframework.boot.maven.JavaProcessExecutor processExecutor, File workingDirectory, List<String> args, Map<String, String> environmentVariables) Run the application.Methods inherited from class AbstractDependencyFilterMojo
filterDependencies, getDependencyURLs, setExcludeGroupIds, setExcludes, setIncludes, toURLMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
AbstractRunMojo
protected AbstractRunMojo(org.apache.maven.toolchain.ToolchainManager toolchainManager)
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
getClassesDirectories
Returns the directories that contain the application's classes and resources. When the application's main class has not been configured, each directory is searched in turn for an appropriate main class.- Returns:
- the directories that contain the application's classes and resources
- Since:
- 3.1.0
-
isUseTestClasspath
protected abstract boolean isUseTestClasspath() -
run
protected abstract void run(org.springframework.boot.maven.JavaProcessExecutor processExecutor, File workingDirectory, List<String> args, Map<String, String> environmentVariables) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionRun the application.- Parameters:
processExecutor- theJavaProcessExecutorto useworkingDirectory- 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- Since:
- 3.0.0
-
resolveApplicationArguments
protected org.springframework.boot.maven.RunArguments resolveApplicationArguments()Resolve the application arguments to use.- Returns:
- a
RunArgumentsdefining the application arguments
-
resolveEnvVariables
protected org.springframework.boot.maven.EnvVariables resolveEnvVariables()Resolve the environment variables to use.- Returns:
- an
EnvVariablesdefining the environment variables
-
resolveJvmArguments
protected org.springframework.boot.maven.RunArguments resolveJvmArguments()Resolve the JVM arguments to use.- Returns:
- a
RunArgumentsdefining the JVM arguments
-
getClassPathUrls
- Throws:
org.apache.maven.plugin.MojoExecutionException
-