aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2022-03-21 11:30:38 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2022-03-23 08:04:17 +0700
commit09d5772dba8fa81ed6ee1a74ae7e7721cfc3787c (patch)
tree394be3d4725e78f213e078980096e673e8239091
parent6dc09db0ca1589f8c53c4dca054e3a852eaaecba (diff)
downloadaspectj-09d5772dba8fa81ed6ee1a74ae7e7721cfc3787c.tar.gz
aspectj-09d5772dba8fa81ed6ee1a74ae7e7721cfc3787c.zip
Use '-Djava.security.manager=allow' on Java 18+ (JEP 411)
JEP 411: Deprecate the Security Manager for Removal, see https://openjdk.java.net/jeps/411. As of Java 18, the new API for blocking System.exit is not available yet, see https://bugs.openjdk.java.net/browse/JDK-8199704. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
-rw-r--r--pom.xml14
-rw-r--r--testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java3
2 files changed, 17 insertions, 0 deletions
diff --git a/pom.xml b/pom.xml
index 3e988779c..d262f8d92 100644
--- a/pom.xml
+++ b/pom.xml
@@ -208,6 +208,20 @@
</properties>
</profile>
<profile>
+ <id>jdk-18-to-xx</id>
+ <activation>
+ <jdk>[18,)</jdk>
+ </activation>
+ <properties>
+ <!--
+ JEP 411: Deprecate the Security Manager for Removal, see https://openjdk.java.net/jeps/411.
+ As of Java 18, the new API for blocking System.exit is not available yet, see
+ https://bugs.openjdk.java.net/browse/JDK-8199704.
+ -->
+ <jvm.arg.addOpens>-Djava.security.manager=allow</jvm.arg.addOpens>
+ </properties>
+ </profile>
+ <profile>
<id>release</id>
<properties>
<maven.javadoc.skip>false</maven.javadoc.skip>
diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java
index 93ca14e70..fa3315396 100644
--- a/testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java
+++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java
@@ -600,6 +600,9 @@ public class JavaRun implements IAjcRun {
public static class Spec extends AbstractRunSpec {
static {
try {
+ // TODO: Deprecate the Security Manager for Removal, see https://openjdk.java.net/jeps/411.
+ // As of Java 18, the new API for blocking System.exit is not available yet, see
+ // https://bugs.openjdk.java.net/browse/JDK-8199704.
System.setSecurityManager(RunSecurityManager.ME);
} catch (Throwable t) {
System.err.println("JavaRun: Security manager set - no System.exit() protection");