aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2022-03-31 12:50:14 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2022-03-31 14:39:35 +0700
commit3dc53e0351a37fc6d3f6a6e311df0320987edc48 (patch)
tree6c4f87c3d0b9dd91b449b746cd5ffb1beb2a59ba
parentaae62efb0a338bafbcc17187bd21778191993a7b (diff)
downloadaspectj-3dc53e0351a37fc6d3f6a6e311df0320987edc48.tar.gz
aspectj-3dc53e0351a37fc6d3f6a6e311df0320987edc48.zip
POM bug: separate jvm.arg.allowSecurityManager from jvm.arg.addOpens
Before, this was in a single variable, and for JDK 18+, the security manager setting also falsely overwrote the '--add-opens' command. This was the root cause for a few dozen LTW tests to fail on JDK 18, if they were not run in full LTW mode, i.e. in a separate JVM. After this fix, it should be possible to revert the corresponding commits, at least their non-cosmetic parts. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
-rw-r--r--docs/developer/BUILD.md8
-rw-r--r--pom.xml9
-rw-r--r--run-all-junit-tests/pom.xml6
-rw-r--r--testing-drivers/pom.xml5
-rw-r--r--tests/pom.xml5
5 files changed, 25 insertions, 8 deletions
diff --git a/docs/developer/BUILD.md b/docs/developer/BUILD.md
index d19c4013d..2cc8bfff5 100644
--- a/docs/developer/BUILD.md
+++ b/docs/developer/BUILD.md
@@ -110,12 +110,16 @@ Other existing profiles, which developers are less likely to actively use becaus
profile is inactive by default, because in the context of a Maven build it would cause all tests to be run twice
(during module build and again when running the big suite), hence the profile name.
- * `jdk-8-to-15` - Activated automatically on JDKs 8-15, setting property `jvm.arg.addOpens` to an empty value, because
- it is only needed on JDK 16+, see next bullet point.
+ * `jdk-8-to-15` - Activated automatically on JDKs 8-15, setting properties `jvm.arg.addOpens` and
+ `jvm.arg.allowSecurityManager` to empty values, because they are only needed on JDK 16+ or 18+, respectively. See
+ next bullet point.
* `jdk-16-to-xx` - Activated automatically on JDKs 16+, setting property `jvm.arg.addOpens` to value
`--add-opens java.base/java.lang=ALL-UNNAMED`, which is needed in order to run LTW tests.
+ * `jdk-18-to-xx` - Activated automatically on JDKs 18+, setting property `jvm.arg.allowSecurityManager` to value
+ `-Djava.security.manager=allow`, which is needed by some tests in order to override `System.exit`.
+
### Build properties
The following properties and their default values in different profile are used in order to activate or skip Maven
diff --git a/pom.xml b/pom.xml
index b5b640a9d..cade005da 100644
--- a/pom.xml
+++ b/pom.xml
@@ -196,6 +196,7 @@
</activation>
<properties>
<jvm.arg.addOpens/>
+ <jvm.arg.allowSecurityManager/>
</properties>
</profile>
<profile>
@@ -205,6 +206,7 @@
</activation>
<properties>
<jvm.arg.addOpens>--add-opens java.base/java.lang=ALL-UNNAMED</jvm.arg.addOpens>
+ <jvm.arg.allowSecurityManager/>
</properties>
</profile>
<profile>
@@ -218,7 +220,7 @@
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>
+ <jvm.arg.allowSecurityManager>-Djava.security.manager=allow</jvm.arg.allowSecurityManager>
</properties>
</profile>
<profile>
@@ -268,7 +270,10 @@
<version>2.22.2</version>
<configuration>
<!--<testFailureIgnore>true</testFailureIgnore>-->
- <argLine>${jvm.arg.addOpens}</argLine>
+ <argLine>
+ ${jvm.arg.addOpens}
+ ${jvm.arg.allowSecurityManager}
+ </argLine>
<excludes>
<exclude>**/*ModuleTests.java</exclude>
</excludes>
diff --git a/run-all-junit-tests/pom.xml b/run-all-junit-tests/pom.xml
index 583acfae1..30df18d38 100644
--- a/run-all-junit-tests/pom.xml
+++ b/run-all-junit-tests/pom.xml
@@ -198,7 +198,10 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
- <argLine>${jvm.arg.addOpens}</argLine>
+ <argLine>
+ ${jvm.arg.addOpens}
+ ${jvm.arg.allowSecurityManager}
+ </argLine>
</configuration>
<executions>
<execution>
@@ -253,4 +256,3 @@
</build>
</project>
-
diff --git a/testing-drivers/pom.xml b/testing-drivers/pom.xml
index e22c688a2..30b75c3ca 100644
--- a/testing-drivers/pom.xml
+++ b/testing-drivers/pom.xml
@@ -55,7 +55,10 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
- <argLine>${jvm.arg.addOpens}</argLine>
+ <argLine>
+ ${jvm.arg.addOpens}
+ ${jvm.arg.allowSecurityManager}
+ </argLine>
<excludes>
<exclude>**/*AjcTestSpecAsTest*</exclude>
</excludes>
diff --git a/tests/pom.xml b/tests/pom.xml
index 21efac3cc..7b5e400bd 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -122,7 +122,10 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration combine.self="override">
<testFailureIgnore>false</testFailureIgnore>
- <argLine>${jvm.arg.addOpens}</argLine>
+ <argLine>
+ ${jvm.arg.addOpens}
+ ${jvm.arg.allowSecurityManager}
+ </argLine>
<includes>
<include>**/TestsModuleTests*</include>
</includes>