summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaikiran Pai <jaikiran@apache.org>2021-11-28 19:53:20 +0530
committerJaikiran Pai <jaikiran@apache.org>2021-11-28 19:53:20 +0530
commitf3e3345e8af2b117e79757690644a04bb584bf82 (patch)
tree7a356857b90d5cac2877735de8ece37f56f2920f
parent5086264e00fb26b96915eb57d347a3473ca5ea85 (diff)
downloadant-f3e3345e8af2b117e79757690644a04bb584bf82.tar.gz
launch Ant project tests by passing java.security.manager=allow on Java 18
-rw-r--r--build.xml10
1 files changed, 10 insertions, 0 deletions
diff --git a/build.xml b/build.xml
index cc184a323..8d401aac7 100644
--- a/build.xml
+++ b/build.xml
@@ -1756,6 +1756,9 @@ ${antunit.reports}
<javaversion atleast="9"/>
</not>
</condition>
+ <condition property="java.security.manager" value="allow">
+ <javaversion exactly="18"/>
+ </condition>
<macrodef name="test-junit">
<element name="junit-nested" implicit="true"/>
<sequential>
@@ -1806,6 +1809,13 @@ ${antunit.reports}
<syspropertyset>
<propertyref name="sun.io.useCanonCaches"/>
</syspropertyset>
+ <!-- Many JUnit tests, in the Ant project, launch Java programs through Ant's
+ java task, which internally calls System.setSecurityManager(). In Java 18
+ an explicit system property value needs to be set to prevent exception from
+ being thrown from that call -->
+ <syspropertyset>
+ <propertyref name="java.security.manager"/>
+ </syspropertyset>
<classpath>
<path refid="tests-runtime-classpath"/>
<pathelement location="${junit.collector.dir}"/>