private ForkConfiguration createForkConfiguration()

in maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java [2253:2317]


    private ForkConfiguration createForkConfiguration(
            @Nonnull Platform platform, @Nonnull ResolvePathResultWrapper resolvedJavaModularityResult)
            throws MojoExecutionException {
        File tmpDir = getSurefireTempDir();

        Artifact shadeFire = getShadefireArtifact();

        Classpath bootClasspath = getArtifactClasspath(shadeFire != null ? shadeFire : getBooterArtifact());

        ForkNodeFactory forkNode = getForkNodeFactory();

        getConsoleLogger()
                .debug("Found implementation of fork node factory: "
                        + forkNode.getClass().getName());

        if (canExecuteProviderWithModularPath(platform, resolvedJavaModularityResult)) {
            return new ModularClasspathForkConfiguration(
                    bootClasspath,
                    tmpDir,
                    getEffectiveDebugForkedProcess(),
                    getWorkingDirectory() != null ? getWorkingDirectory() : getBasedir(),
                    getProject().getModel().getProperties(),
                    getArgLine(),
                    getEnvironmentVariables(),
                    getExcludedEnvironmentVariables(),
                    getConsoleLogger().isDebugEnabled(),
                    getEffectiveForkCount(),
                    reuseForks,
                    platform,
                    getConsoleLogger(),
                    forkNode);
        } else if (getClassLoaderConfiguration().isManifestOnlyJarRequestedAndUsable()) {
            return new JarManifestForkConfiguration(
                    bootClasspath,
                    tmpDir,
                    getEffectiveDebugForkedProcess(),
                    getWorkingDirectory() != null ? getWorkingDirectory() : getBasedir(),
                    getProject().getModel().getProperties(),
                    getArgLine(),
                    getEnvironmentVariables(),
                    getExcludedEnvironmentVariables(),
                    getConsoleLogger().isDebugEnabled(),
                    getEffectiveForkCount(),
                    reuseForks,
                    platform,
                    getConsoleLogger(),
                    forkNode);
        } else {
            return new ClasspathForkConfiguration(
                    bootClasspath,
                    tmpDir,
                    getEffectiveDebugForkedProcess(),
                    getWorkingDirectory() != null ? getWorkingDirectory() : getBasedir(),
                    getProject().getModel().getProperties(),
                    getArgLine(),
                    getEnvironmentVariables(),
                    getExcludedEnvironmentVariables(),
                    getConsoleLogger().isDebugEnabled(),
                    getEffectiveForkCount(),
                    reuseForks,
                    platform,
                    getConsoleLogger(),
                    forkNode);
        }
    }