Skip to content

Commit 2bb9d16

Browse files
Refine JVM flags to only enable dynamic agent loading
Per Mockito documentation section 0.3, the proper approach for Java 21+ is to use -XX:+EnableDynamicAgentLoading flag. Removed unnecessary warning suppressions for native access and sun.misc package opening, which were too broad and hide legitimate warnings. Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
1 parent 7ba2cfe commit 2bb9d16

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
2525
<jjwt.version>0.13.0</jjwt.version>
2626
<okhttp.version>5.3.2</okhttp.version>
27-
<!-- Default argLine for surefire/failsafe - JaCoCo will prepend to this -->
28-
<argLine>-XX:+EnableDynamicAgentLoading --enable-native-access=ALL-UNNAMED --add-opens java.base/sun.misc=ALL-UNNAMED</argLine>
27+
<!-- Enable dynamic agent loading for Mockito/Byte Buddy as recommended by Mockito docs -->
28+
<argLine>-XX:+EnableDynamicAgentLoading</argLine>
2929
</properties>
3030
<organization>
3131
<name>Berry Cloud Ltd</name>

0 commit comments

Comments
 (0)