mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Polish "Allow additional JVM args when running tests via toolchain"
See gh-27089
This commit is contained in:
parent
01b0156fed
commit
705feeed6a
@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.boot.build.toolchain;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.plugins.JavaPluginExtension;
|
||||
@ -69,10 +71,8 @@ public class ToolchainPlugin implements Plugin<Project> {
|
||||
}
|
||||
|
||||
private void configureTestToolchain(Project project, ToolchainExtension toolchain) {
|
||||
if (!toolchain.getTestJvmArgs().isPresent()) {
|
||||
return;
|
||||
}
|
||||
project.getTasks().withType(Test.class, (test) -> test.jvmArgs(toolchain.getTestJvmArgs().get()));
|
||||
project.getTasks().withType(Test.class,
|
||||
(test) -> test.jvmArgs(toolchain.getTestJvmArgs().getOrElse(Collections.emptyList())));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,10 +9,6 @@ plugins {
|
||||
|
||||
description = "Spring Boot"
|
||||
|
||||
toolchain {
|
||||
testJvmArgs.add("--add-opens=java.base/java.net=ALL-UNNAMED")
|
||||
}
|
||||
|
||||
def tomcatConfigProperties = "$buildDir/tomcat-config-properties"
|
||||
|
||||
configurations {
|
||||
@ -154,3 +150,7 @@ compileTestKotlin {
|
||||
compileJava {
|
||||
doLast new org.springframework.boot.build.log4j2.ReproducibleLog4j2PluginsDatAction()
|
||||
}
|
||||
|
||||
toolchain {
|
||||
testJvmArgs.add("--add-opens=java.base/java.net=ALL-UNNAMED")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user