Skip to content

Commit 5a5abd4

Browse files
committed
use add-opens in surefire only when running in jdk9+
1 parent d1feef2 commit 5a5abd4

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

pom.xml

+21-9
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,6 @@
220220
</execution>
221221
</executions>
222222
</plugin>
223-
<plugin>
224-
<groupId>org.apache.maven.plugins</groupId>
225-
<artifactId>maven-surefire-plugin</artifactId>
226-
<configuration>
227-
<!-- This arg line allows inter-module access when Gson serializes
228-
the private variables of java.time.Duration -->
229-
<argLine>--add-opens java.base/java.time=ALL-UNNAMED</argLine>
230-
</configuration>
231-
</plugin>
232223
</plugins>
233224
</pluginManagement>
234225
</build>
@@ -308,4 +299,25 @@
308299
</plugin>
309300
</plugins>
310301
</reporting>
302+
<profiles>
303+
<profile>
304+
<id>java9</id>
305+
<activation>
306+
<jdk>[9,)</jdk>
307+
</activation>
308+
<build>
309+
<plugins>
310+
<plugin>
311+
<groupId>org.apache.maven.plugins</groupId>
312+
<artifactId>maven-surefire-plugin</artifactId>
313+
<configuration>
314+
<!-- This arg line allows inter-module access when Gson serializes
315+
the private variables of java.time.Duration -->
316+
<argLine>--add-opens java.base/java.time=ALL-UNNAMED</argLine>
317+
</configuration>
318+
</plugin>
319+
</plugins>
320+
</build>
321+
</profile>
322+
</profiles>
311323
</project>

0 commit comments

Comments
 (0)