Class DefaultForkConfiguration
java.lang.Object
org.apache.maven.plugin.surefire.booterclient.ForkConfiguration
org.apache.maven.plugin.surefire.booterclient.DefaultForkConfiguration
- Direct Known Subclasses:
AbstractClasspathForkConfiguration,ModularClasspathForkConfiguration
Basic framework which constructs CLI.
- Since:
- 2.21.0.Jigsaw
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final Classpathprivate final booleanprivate final Stringprivate final String[]private final intprivate final ConsoleLoggerprivate final Propertiesprivate final Platformprivate final booleanprivate final Fileprivate final FileFields inherited from class org.apache.maven.plugin.surefire.booterclient.ForkConfiguration
DEFAULT_PROVIDER_CLASS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultForkConfiguration(Classpath booterClasspath, File tempDirectory, String debugLine, File workingDirectory, Properties modelProperties, String argLine, Map<String, String> environmentVariables, String[] excludedEnvironmentVariables, boolean debug, int forkCount, boolean reuseForks, Platform pluginPlatform, ConsoleLogger log) -
Method Summary
Modifier and TypeMethodDescriptioncreateCommandLine(StartupConfiguration config, int forkNumber, File dumpLogDirectory) protected StringextendJvmArgLine(String jvmArgLine) private static StringfindStartClass(StartupConfiguration config) protected Stringprotected Classpathprotected Stringprotected String[]protected intprotected JdkAttributesprotected ConsoleLoggerprotected Propertiesprotected Platformprotected Fileprivate FilegetWorkingDirectory(int forkNumber) private StringReplaces expressionsprotected booleanisDebug()protected booleanprivate StringnewJvmArgLine(int forks) protected abstract voidresolveClasspath(OutputStreamFlushableCommandline cli, String booterThatHasMainMethod, StartupConfiguration config, File dumpLogDirectory) private static StringstripNewLines(String argLine) private static <K,V> Map<K, V> toImmutable(Map<K, V> map) Immutable map.
-
Field Details
-
booterClasspath
-
tempDirectory
-
debugLine
-
workingDirectory
-
modelProperties
-
argLine
-
environmentVariables
-
excludedEnvironmentVariables
-
debug
private final boolean debug -
forkCount
private final int forkCount -
reuseForks
private final boolean reuseForks -
pluginPlatform
-
log
-
-
Constructor Details
-
DefaultForkConfiguration
protected DefaultForkConfiguration(@Nonnull Classpath booterClasspath, @Nonnull File tempDirectory, @Nullable String debugLine, @Nonnull File workingDirectory, @Nonnull Properties modelProperties, @Nullable String argLine, @Nonnull Map<String, String> environmentVariables, @Nonnull String[] excludedEnvironmentVariables, boolean debug, int forkCount, boolean reuseForks, @Nonnull Platform pluginPlatform, @Nonnull ConsoleLogger log)
-
-
Method Details
-
resolveClasspath
protected abstract void resolveClasspath(@Nonnull OutputStreamFlushableCommandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config, @Nonnull File dumpLogDirectory) throws SurefireBooterForkException - Throws:
SurefireBooterForkException
-
extendJvmArgLine
-
createCommandLine
@Nonnull public OutputStreamFlushableCommandline createCommandLine(@Nonnull StartupConfiguration config, int forkNumber, @Nonnull File dumpLogDirectory) throws SurefireBooterForkException - Specified by:
createCommandLinein 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:
SurefireBooterForkException- when unable to perform the fork
-
getLogger
-
toCompleteClasspath
@Nonnull protected List<String> toCompleteClasspath(StartupConfiguration conf) throws SurefireBooterForkException - Throws:
SurefireBooterForkException
-
getWorkingDirectory
- Throws:
SurefireBooterForkException
-
interpolateArgLineWithPropertyExpressions
Replaces expressions@{property-name}with the corresponding properties from the model. This allows late evaluation of property values when the plugin is executed (as compared to evaluation when the pom is parsed as is done with${property-name}expressions). This allows other plugins to modify or set properties with the changes getting picked up by surefire. -
stripNewLines
-
toImmutable
Immutable map.- Type Parameters:
K- key typeV- value type- Parameters:
map- immutable map copies elements frommap- Returns:
- never returns null
-
getTempDirectory
- Specified by:
getTempDirectoryin classForkConfiguration
-
getDebugLine
- Specified by:
getDebugLinein classForkConfiguration
-
getWorkingDirectory
- Specified by:
getWorkingDirectoryin classForkConfiguration
-
getModelProperties
- Specified by:
getModelPropertiesin classForkConfiguration
-
getArgLine
- Specified by:
getArgLinein classForkConfiguration
-
getEnvironmentVariables
- Specified by:
getEnvironmentVariablesin classForkConfiguration
-
getExcludedEnvironmentVariables
- Specified by:
getExcludedEnvironmentVariablesin classForkConfiguration
-
isDebug
protected boolean isDebug()- Specified by:
isDebugin classForkConfiguration
-
getForkCount
protected int getForkCount()- Specified by:
getForkCountin classForkConfiguration
-
isReuseForks
protected boolean isReuseForks()- Specified by:
isReuseForksin classForkConfiguration
-
getPluginPlatform
- Specified by:
getPluginPlatformin classForkConfiguration
-
getJdkForTests
- Specified by:
getJdkForTestsin classForkConfiguration
-
getBooterClasspath
- Specified by:
getBooterClasspathin classForkConfiguration
-
newJvmArgLine
-
findStartClass
-