Skip to content

Commit 035adde

Browse files
authored
ci: Java 17 profile to run tests with old Mockito (#1343)
1 parent d931375 commit 035adde

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

pom.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,5 +264,35 @@
264264
<sourceFileExclude>com/google/cloud/firestore/v1/package-info.java</sourceFileExclude>
265265
</properties>
266266
</profile>
267+
268+
<profile>
269+
<!--
270+
Due to old Mockito version, naive Java 17 junit test fails due to
271+
'ClassFormatError accessible: module java.base does not "opens java.lang"
272+
to unnamed module'
273+
-->
274+
<id>java17</id>
275+
<activation>
276+
<jdk>[17,)</jdk>
277+
<property>
278+
<!--
279+
In Java 8 unit tests where we run tests in Java 8 after building
280+
bytecode on Java 17, we don't want to add the argLine
281+
-->
282+
<name>!jvm</name>
283+
</property>
284+
</activation>
285+
<build>
286+
<plugins>
287+
<plugin>
288+
<groupId>org.apache.maven.plugins</groupId>
289+
<artifactId>maven-surefire-plugin</artifactId>
290+
<configuration>
291+
<argLine>--add-opens=java.base/java.lang=ALL-UNNAMED</argLine>
292+
</configuration>
293+
</plugin>
294+
</plugins>
295+
</build>
296+
</profile>
267297
</profiles>
268298
</project>

0 commit comments

Comments
 (0)