Skip to content

Commit

Permalink
use add-opens in surefire only when running in jdk9+
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarquezp committed Nov 22, 2024
1 parent d1feef2 commit 5a5abd4
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- This arg line allows inter-module access when Gson serializes
the private variables of java.time.Duration -->
<argLine>--add-opens java.base/java.time=ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down Expand Up @@ -308,4 +299,25 @@
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>java9</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- This arg line allows inter-module access when Gson serializes
the private variables of java.time.Duration -->
<argLine>--add-opens java.base/java.time=ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 5a5abd4

Please sign in to comment.