diff options
author | Éamonn McManus <emcmanus@google.com> | 2021-03-12 08:55:32 -0800 |
---|---|---|
committer | Google Java Core Libraries <java-libraries-firehose+copybara@google.com> | 2021-03-12 08:55:59 -0800 |
commit | cdbae3556b2ddb910f923b5d83c4c188a9addf2f (patch) | |
tree | efb6bf7648ea29c1eb68c24c0eb94bf043fbafb4 /factory | |
parent | 984e89300b2483018e392399c74bf7ef1844f289 (diff) | |
download | auto-cdbae3556b2ddb910f923b5d83c4c188a9addf2f.tar.gz |
Ensure compilation tests will run on JDK 16+.
As noted [here](https://github.com/google/compile-testing/issues/222), the change of the default `--illegal-access` from `permit` to `deny` will cause compile-testing tests to fail by default, with messages like this:
```
class com.google.testing.compile.Parser (in unnamed module @0x4114d843) cannot
access class com.sun.tools.javac.api.JavacTool (in module jdk.compiler) because
module jdk.compiler does not export com.sun.tools.javac.api to unnamed module
@0x4114d843
```
We can work around that by supplying the necessary `--add-opens` flag to the JVM that runs the tests.
RELNOTES=n/a
PiperOrigin-RevId: 362531170
Diffstat (limited to 'factory')
-rw-r--r-- | factory/pom.xml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/factory/pom.xml b/factory/pom.xml index be10d549..50d9314b 100644 --- a/factory/pom.xml +++ b/factory/pom.xml @@ -169,6 +169,14 @@ </dependencies> </plugin> <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.22.2</version> + <configuration> + <argLine>${test.jvm.flags}</argLine> + </configuration> + </plugin> + <plugin> <artifactId>maven-jar-plugin</artifactId> <version>3.2.0</version> </plugin> @@ -200,4 +208,15 @@ </plugin> </plugins> </build> + <profiles> + <profile> + <id>open-modules</id> + <activation> + <jdk>[9,)</jdk> + </activation> + <properties> + <test.jvm.flags>--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</test.jvm.flags> + </properties> + </profile> + </profiles> </project> |