Skip to content

Commit 3ab77a1

Browse files
committed
fix: move mockito argLine to all test plugins
surefire, failsafe, vmlens all need mockito argline to work with Java 21+ to avoid deprecated dynamic java agent loading.
1 parent c034394 commit 3ab77a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<!-- this will throw an error if we use wrong apis -->
2222
<maven.compiler.release>11</maven.compiler.release>
2323
<org.mockito.jar>${settings.localRepository}/org/mockito/mockito-core/${org.mockito.version}/mockito-core-${org.mockito.version}.jar</org.mockito.jar>
24-
<surefireArgLine>-javaagent:${org.mockito.jar}</surefireArgLine>
24+
<org.mockito.agent.argline>-javaagent:${org.mockito.jar}</org.mockito.agent.argline>
2525
</properties>
2626

2727
<name>OpenFeature Java SDK</name>
@@ -304,6 +304,7 @@
304304
<configuration>
305305
<argLine>
306306
${surefireArgLine}
307+
${org.mockito.agent.argline}
307308
--add-opens java.base/java.util=ALL-UNNAMED
308309
--add-opens java.base/java.lang=ALL-UNNAMED
309310
</argLine>
@@ -321,6 +322,7 @@
321322
<configuration>
322323
<argLine>
323324
${surefireArgLine}
325+
${org.mockito.agent.argline}
324326
</argLine>
325327
</configuration>
326328
</plugin>
@@ -364,6 +366,7 @@
364366
<include>**/*CT.java</include>
365367
</includes>
366368
<failIfNoTests>true</failIfNoTests>
369+
<argLine>${org.mockito.agent.argline}</argLine>
367370
</configuration>
368371
</execution>
369372
</executions>
@@ -740,6 +743,7 @@
740743
<version>3.5.4</version>
741744
<configuration>
742745
<argLine>
746+
${org.mockito.agent.argline}
743747
${surefireArgLine}
744748
</argLine>
745749
</configuration>

0 commit comments

Comments
 (0)