1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugin.surefire.booterclient;
20
21 import javax.annotation.Nonnull;
22 import javax.annotation.Nullable;
23
24 import java.io.File;
25 import java.util.Map;
26 import java.util.Properties;
27
28 import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.Commandline;
29 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
30 import org.apache.maven.surefire.booter.Classpath;
31 import org.apache.maven.surefire.booter.StartupConfiguration;
32 import org.apache.maven.surefire.booter.SurefireBooterForkException;
33 import org.apache.maven.surefire.extensions.ForkNodeFactory;
34
35 import static org.apache.maven.surefire.shared.utils.StringUtils.join;
36
37
38
39
40
41 public final class ClasspathForkConfiguration extends AbstractClasspathForkConfiguration {
42 @SuppressWarnings("checkstyle:parameternumber")
43 public ClasspathForkConfiguration(
44 @Nonnull Classpath bootClasspath,
45 @Nonnull File tempDirectory,
46 @Nullable String debugLine,
47 @Nonnull File workingDirectory,
48 @Nonnull Properties modelProperties,
49 @Nullable String argLine,
50 @Nonnull Map<String, String> environmentVariables,
51 @Nonnull String[] excludedEnvironmentVariables,
52 boolean debug,
53 int forkCount,
54 boolean reuseForks,
55 @Nonnull Platform pluginPlatform,
56 @Nonnull ConsoleLogger log,
57 @Nonnull ForkNodeFactory forkNodeFactory) {
58 super(
59 bootClasspath,
60 tempDirectory,
61 debugLine,
62 workingDirectory,
63 modelProperties,
64 argLine,
65 environmentVariables,
66 excludedEnvironmentVariables,
67 debug,
68 forkCount,
69 reuseForks,
70 pluginPlatform,
71 log,
72 forkNodeFactory);
73 }
74
75 @Override
76 protected void resolveClasspath(
77 @Nonnull Commandline cli,
78 @Nonnull String booterThatHasMainMethod,
79 @Nonnull StartupConfiguration config,
80 @Nonnull File dumpLogDirectory)
81 throws SurefireBooterForkException {
82 cli.addEnvironment("CLASSPATH", join(toCompleteClasspath(config).iterator(), File.pathSeparator));
83 cli.createArg().setValue(booterThatHasMainMethod);
84 }
85 }