Skip to content

Commit

Permalink
only add opens when running with jdk 17
Browse files Browse the repository at this point in the history
  • Loading branch information
hrothwell committed Mar 28, 2024
1 parent ae8c66c commit 734749c
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
<maven-versions-plugin.version>2.8.1</maven-versions-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
<dokka.version>1.6.10</dokka.version>
</properties>

Expand Down Expand Up @@ -244,17 +245,6 @@
</execution>
</executions>
</plugin>
<!-- java 9+ fix for tests, open modules in java.lang -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -412,6 +402,28 @@
</plugins>
</build>
</profile>
<profile>
<id>building-with-jdk-17</id>
<activation>
<jdk>17</jdk>
</activation>
<build>
<plugins>
<!-- java 9+ fix for tests, open modules in java.lang -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<argLine>
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>

0 comments on commit 734749c

Please sign in to comment.