Package org.springframework.boot.maven
Class TestRunMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.springframework.boot.maven.AbstractDependencyFilterMojo
org.springframework.boot.maven.AbstractRunMojo
org.springframework.boot.maven.TestRunMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="test-run",
requiresProject=true,
defaultPhase=VALIDATE,
requiresDependencyResolution=TEST)
@Execute(phase=TEST_COMPILE)
public class TestRunMojo
extends AbstractRunMojo
Run an application in place using the test runtime classpath. The main class that will
be used to launch the application is determined as follows: The configured main class,
if any. Then the main class found in the test classes directory, if any. Then the main
class found in the classes directory, if any.
- Since:
- 3.1.0
- Author:
- Phillip Webb, Dmytro Nosan, Stephane Nicoll, Andy Wilkinson
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.boot.maven.AbstractDependencyFilterMojo
AbstractDependencyFilterMojo.ExcludeTestScopeArtifactFilter, AbstractDependencyFilterMojo.RuntimeArtifactFilter -
Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the directories that contain the application's classes and resources.protected booleanprotected org.springframework.boot.maven.RunArgumentsResolve the JVM arguments to use.protected voidrun(org.springframework.boot.maven.JavaProcessExecutor processExecutor, File workingDirectory, List<String> args, Map<String, String> environmentVariables) Run the application.Methods inherited from class org.springframework.boot.maven.AbstractRunMojo
execute, getClassPathUrls, resolveApplicationArguments, resolveEnvVariablesMethods inherited from class org.springframework.boot.maven.AbstractDependencyFilterMojo
filterDependencies, getDependencyURLs, setExcludeGroupIds, setExcludes, setIncludes, toURLMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
TestRunMojo
public TestRunMojo()
-
-
Method Details
-
getClassesDirectories
Description copied from class:AbstractRunMojoReturns 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.- Overrides:
getClassesDirectoriesin classAbstractRunMojo- Returns:
- the directories that contain the application's classes and resources
-
isUseTestClasspath
protected boolean isUseTestClasspath()- Specified by:
isUseTestClasspathin classAbstractRunMojo
-
resolveJvmArguments
protected org.springframework.boot.maven.RunArguments resolveJvmArguments()Description copied from class:AbstractRunMojoResolve the JVM arguments to use.- Overrides:
resolveJvmArgumentsin classAbstractRunMojo- Returns:
- a
RunArgumentsdefining the JVM arguments
-
run
protected 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.MojoFailureExceptionDescription copied from class:AbstractRunMojoRun the application.- Specified by:
runin classAbstractRunMojo- 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
-