Better JDK-18 EA (and beyond) support of SecurityManager (#1750)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
This commit is contained in:
Andriy Redko 2021-12-16 17:57:22 -05:00 committed by GitHub
parent 20692a2ff2
commit 82a4f45f80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -346,6 +346,15 @@ gradle.projectsEvaluated {
if (tasks.findByPath('test') != null && tasks.findByPath('integTest') != null) { if (tasks.findByPath('test') != null && tasks.findByPath('integTest') != null) {
integTest.mustRunAfter test integTest.mustRunAfter test
} }
project.tasks.withType(Test) { task ->
if (task != null) {
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_17) {
task.jvmArgs += ["-Djava.security.manager=allow"]
}
}
}
configurations.matching { it.canBeResolved }.all { Configuration configuration -> configurations.matching { it.canBeResolved }.all { Configuration configuration ->
dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep -> dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep ->
Project upstreamProject = dep.dependencyProject Project upstreamProject = dep.dependencyProject

View File

@ -26,4 +26,4 @@ systemProp.org.gradle.warning.mode=fail
systemProp.jdk.tls.client.protocols=TLSv1.2 systemProp.jdk.tls.client.protocols=TLSv1.2
# jvm args for faster test execution by default # jvm args for faster test execution by default
systemProp.tests.jvm.argline=-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m -Djava.security.manager=allow systemProp.tests.jvm.argline=-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m