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 String
private final Classpath
private final boolean
private final String
private final String[]
private final int
private final ForkNodeFactory
private final ConsoleLogger
private final Properties
private final Platform
private final boolean
private final File
private final File
Fields inherited from class org.apache.maven.plugin.surefire.booterclient.ForkConfiguration
DEFAULT_PROVIDER_CLASS
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DefaultForkConfiguration
(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, ForkNodeFactory forkNodeFactory) -
Method Summary
Modifier and TypeMethodDescriptioncreateCommandLine
(StartupConfiguration config, int forkNumber, File dumpLogDirectory) protected String
extendJvmArgLine
(String jvmArgLine) private static String
findStartClass
(StartupConfiguration config) protected String
protected Classpath
protected String
protected String[]
protected int
final ForkNodeFactory
protected JdkAttributes
protected ConsoleLogger
protected Properties
protected Platform
protected File
private File
getWorkingDirectory
(int forkNumber) private String
Replaces expressionsprotected boolean
isDebug()
protected boolean
private String
newJvmArgLine
(int forks) protected abstract void
resolveClasspath
(Commandline cli, String booterThatHasMainMethod, StartupConfiguration config, File dumpLogDirectory) private static String
stripNewLines
(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
-
forkNodeFactory
-
-
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, @Nonnull ForkNodeFactory forkNodeFactory)
-
-
Method Details
-
resolveClasspath
protected abstract void resolveClasspath(@Nonnull Commandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config, @Nonnull File dumpLogDirectory) throws SurefireBooterForkException - Throws:
SurefireBooterForkException
-
extendJvmArgLine
-
getForkNodeFactory
- Specified by:
getForkNodeFactory
in classForkConfiguration
-
createCommandLine
@Nonnull public Commandline createCommandLine(@Nonnull StartupConfiguration config, int forkNumber, @Nonnull File dumpLogDirectory) throws 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:
SurefireBooterForkException
- when unable to perform the fork
-
getLogger
-
toCompleteClasspath
@Nonnull protected List<String> toCompleteClasspath(@Nonnull 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:
getTempDirectory
in classForkConfiguration
-
getDebugLine
- Specified by:
getDebugLine
in classForkConfiguration
-
getWorkingDirectory
- Specified by:
getWorkingDirectory
in classForkConfiguration
-
getModelProperties
- Specified by:
getModelProperties
in classForkConfiguration
-
getArgLine
- Specified by:
getArgLine
in classForkConfiguration
-
getEnvironmentVariables
- Specified by:
getEnvironmentVariables
in classForkConfiguration
-
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
- Specified by:
getPluginPlatform
in classForkConfiguration
-
getJdkForTests
- Specified by:
getJdkForTests
in classForkConfiguration
-
getBooterClasspath
- Specified by:
getBooterClasspath
in classForkConfiguration
-
newJvmArgLine
-
findStartClass
-