Skip to content

Commit

Permalink
[RELEASE-FIX] Fix unittests on jdk 17 (#7)
Browse files Browse the repository at this point in the history
Newer dependency should not result in errors like `cannot access class com.sun.tools.javac.api.JavacTool`
Also required to add some JVM flags for tests, as the dependency alone is not enough.
Inspired by google/compile-testing@e794c75
  • Loading branch information
BertScholten authored Mar 7, 2024
1 parent 0f4af88 commit 09d87a3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<junit.version>5.1.0</junit.version>
<junit-platform.version>1.1.0</junit-platform.version>
<opentest4j.version>1.0.0</opentest4j.version>
<testing-compile.version>0.19</testing-compile.version>
<testing-compile.version>0.21.0</testing-compile.version>
<maven.surefire.plugin.version>2.19</maven.surefire.plugin.version>

<maven.compiler.source>1.8</maven.compiler.source>
Expand Down Expand Up @@ -327,6 +327,19 @@
</plugins>
</build>
</profile>
<profile>
<id>add-exports</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<properties>
<test.jvm.flags>
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
</test.jvm.flags>
</properties>
</profile>
</profiles>

</project>
3 changes: 3 additions & 0 deletions processors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${test.jvm.flags}</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down

0 comments on commit 09d87a3

Please sign in to comment.