Class DefaultForkConfiguration
- java.lang.Object
-
- org.apache.maven.plugin.surefire.booterclient.ForkConfiguration
-
- org.apache.maven.plugin.surefire.booterclient.DefaultForkConfiguration
-
- Direct Known Subclasses:
ClasspathForkConfiguration
,JarManifestForkConfiguration
,ModularClasspathForkConfiguration
public abstract class DefaultForkConfiguration extends ForkConfiguration
Basic framework which constructs CLI.- Since:
- 2.21.0.Jigsaw
- Author:
- Tibor Digana (tibor17)
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultForkConfiguration(org.apache.maven.surefire.booter.Classpath booterClasspath, java.io.File tempDirectory, java.lang.String debugLine, java.io.File workingDirectory, java.util.Properties modelProperties, java.lang.String argLine, java.util.Map<java.lang.String,java.lang.String> environmentVariables, java.lang.String[] excludedEnvironmentVariables, boolean debug, int forkCount, boolean reuseForks, Platform pluginPlatform, org.apache.maven.plugin.surefire.log.api.ConsoleLogger log, org.apache.maven.surefire.extensions.ForkNodeFactory forkNodeFactory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Commandline
createCommandLine(org.apache.maven.surefire.booter.StartupConfiguration config, int forkNumber, java.io.File dumpLogDirectory)
protected java.lang.String
extendJvmArgLine(java.lang.String jvmArgLine)
protected java.lang.String
getArgLine()
protected org.apache.maven.surefire.booter.Classpath
getBooterClasspath()
protected java.lang.String
getDebugLine()
protected java.util.Map<java.lang.String,java.lang.String>
getEnvironmentVariables()
protected java.lang.String[]
getExcludedEnvironmentVariables()
protected int
getForkCount()
org.apache.maven.surefire.extensions.ForkNodeFactory
getForkNodeFactory()
protected JdkAttributes
getJdkForTests()
protected org.apache.maven.plugin.surefire.log.api.ConsoleLogger
getLogger()
protected java.util.Properties
getModelProperties()
protected Platform
getPluginPlatform()
java.io.File
getTempDirectory()
protected java.io.File
getWorkingDirectory()
protected boolean
isDebug()
protected boolean
isReuseForks()
protected abstract void
resolveClasspath(Commandline cli, java.lang.String booterThatHasMainMethod, org.apache.maven.surefire.booter.StartupConfiguration config, java.io.File dumpLogDirectory)
protected java.util.List<java.lang.String>
toCompleteClasspath(org.apache.maven.surefire.booter.StartupConfiguration conf)
-
-
-
Constructor Detail
-
DefaultForkConfiguration
protected DefaultForkConfiguration(@Nonnull org.apache.maven.surefire.booter.Classpath booterClasspath, @Nonnull java.io.File tempDirectory, @Nullable java.lang.String debugLine, @Nonnull java.io.File workingDirectory, @Nonnull java.util.Properties modelProperties, @Nullable java.lang.String argLine, @Nonnull java.util.Map<java.lang.String,java.lang.String> environmentVariables, @Nonnull java.lang.String[] excludedEnvironmentVariables, boolean debug, int forkCount, boolean reuseForks, @Nonnull Platform pluginPlatform, @Nonnull org.apache.maven.plugin.surefire.log.api.ConsoleLogger log, @Nonnull org.apache.maven.surefire.extensions.ForkNodeFactory forkNodeFactory)
-
-
Method Detail
-
resolveClasspath
protected abstract void resolveClasspath(@Nonnull Commandline cli, @Nonnull java.lang.String booterThatHasMainMethod, @Nonnull org.apache.maven.surefire.booter.StartupConfiguration config, @Nonnull java.io.File dumpLogDirectory) throws org.apache.maven.surefire.booter.SurefireBooterForkException
- Throws:
org.apache.maven.surefire.booter.SurefireBooterForkException
-
extendJvmArgLine
@Nonnull protected java.lang.String extendJvmArgLine(@Nonnull java.lang.String jvmArgLine)
-
getForkNodeFactory
@Nonnull public final org.apache.maven.surefire.extensions.ForkNodeFactory getForkNodeFactory()
- Specified by:
getForkNodeFactory
in classForkConfiguration
-
createCommandLine
@Nonnull public Commandline createCommandLine(@Nonnull org.apache.maven.surefire.booter.StartupConfiguration config, int forkNumber, @Nonnull java.io.File dumpLogDirectory) throws org.apache.maven.surefire.booter.SurefireBooterForkException
- Specified by:
createCommandLine
in classForkConfiguration
- Parameters:
config
- The startup configurationforkNumber
- index of forked JVM, to be the replacement in the argLinedumpLogDirectory
- directory for dump log file- Returns:
- CommandLine able to flush entire command going to be sent to forked JVM
- Throws:
org.apache.maven.surefire.booter.SurefireBooterForkException
- when unable to perform the fork
-
getLogger
protected org.apache.maven.plugin.surefire.log.api.ConsoleLogger getLogger()
-
toCompleteClasspath
@Nonnull protected java.util.List<java.lang.String> toCompleteClasspath(@Nonnull org.apache.maven.surefire.booter.StartupConfiguration conf) throws org.apache.maven.surefire.booter.SurefireBooterForkException
- Throws:
org.apache.maven.surefire.booter.SurefireBooterForkException
-
getTempDirectory
@Nonnull public java.io.File getTempDirectory()
- Specified by:
getTempDirectory
in classForkConfiguration
-
getDebugLine
@Nullable protected java.lang.String getDebugLine()
- Specified by:
getDebugLine
in classForkConfiguration
-
getWorkingDirectory
@Nonnull protected java.io.File getWorkingDirectory()
- Specified by:
getWorkingDirectory
in classForkConfiguration
-
getModelProperties
@Nonnull protected java.util.Properties getModelProperties()
- Specified by:
getModelProperties
in classForkConfiguration
-
getArgLine
@Nullable protected java.lang.String getArgLine()
- Specified by:
getArgLine
in classForkConfiguration
-
getEnvironmentVariables
@Nonnull protected java.util.Map<java.lang.String,java.lang.String> getEnvironmentVariables()
- Specified by:
getEnvironmentVariables
in classForkConfiguration
-
getExcludedEnvironmentVariables
@Nonnull protected java.lang.String[] getExcludedEnvironmentVariables()
- Specified by:
getExcludedEnvironmentVariables
in classForkConfiguration
-
isDebug
protected boolean isDebug()
- Specified by:
isDebug
in classForkConfiguration
-
getForkCount
protected int getForkCount()
- Specified by:
getForkCount
in classForkConfiguration
-
isReuseForks
protected boolean isReuseForks()
- Specified by:
isReuseForks
in classForkConfiguration
-
getPluginPlatform
@Nonnull protected Platform getPluginPlatform()
- Specified by:
getPluginPlatform
in classForkConfiguration
-
getJdkForTests
@Nonnull protected JdkAttributes getJdkForTests()
- Specified by:
getJdkForTests
in classForkConfiguration
-
getBooterClasspath
@Nonnull protected org.apache.maven.surefire.booter.Classpath getBooterClasspath()
- Specified by:
getBooterClasspath
in classForkConfiguration
-
-