Skip to content

Commit

Permalink
Add --add-opens to surefire for running tests on Java SE 17+ (#565)
Browse files Browse the repository at this point in the history
* Add --add-opens to surefire for running tests on Java SE 17+
* Only set the opens command line for Java SE 11+
Fixes #564
  • Loading branch information
starksm64 authored Jun 28, 2024
1 parent 5c30bf9 commit b220408
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion testenrichers/cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<version.javax-el>2.2</version.javax-el>
<version.slf4j>2.0.12</version.slf4j>

<java11.opensargs></java11.opensargs>
</properties>

<!-- Dependencies -->
Expand Down Expand Up @@ -119,5 +120,30 @@
<scope>test</scope>
</dependency>
</dependencies>
</project>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
${java11.opensargs}
</argLine>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>not-java8</id>
<activation>
<jdk>[11,]</jdk>
</activation>
<properties>
<java11.opensargs>--add-opens java.base/java.lang=ALL-UNNAMED</java11.opensargs>
</properties>
</profile>
</profiles>
</project>

0 comments on commit b220408

Please sign in to comment.