File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
buildSrc/src/main/java/org/opensearch/gradle
distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,9 @@ public void execute(Task t) {
115
115
test .jvmArgs ("--illegal-access=warn" );
116
116
}
117
117
}
118
+ if (test .getJavaVersion ().compareTo (JavaVersion .VERSION_17 ) > 0 ) {
119
+ test .jvmArgs ("-Djava.security.manager=allow" );
120
+ }
118
121
}
119
122
});
120
123
test .getJvmArgumentProviders ().add (nonInputProperties );
Original file line number Diff line number Diff line change @@ -77,12 +77,21 @@ static List<String> systemJvmOptions() {
77
77
// log4j 2
78
78
"-Dlog4j.shutdownHookEnabled=false" ,
79
79
"-Dlog4j2.disable.jmx=true" ,
80
-
80
+ // security manager
81
+ allowSecurityManagerOption (),
81
82
javaLocaleProviders ()
82
83
)
83
84
).stream ().filter (e -> e .isEmpty () == false ).collect (Collectors .toList ());
84
85
}
85
86
87
+ private static String allowSecurityManagerOption () {
88
+ if (Runtime .version ().feature () > 17 ) {
89
+ return "-Djava.security.manager=allow" ;
90
+ } else {
91
+ return "" ;
92
+ }
93
+ }
94
+
86
95
private static String maybeShowCodeDetailsInExceptionMessages () {
87
96
if (Runtime .version ().feature () >= 14 ) {
88
97
return "-XX:+ShowCodeDetailsInExceptionMessages" ;
You can’t perform that action at this time.
0 commit comments