From 5a805b32e626101fa2d7ff334bb6be2cfc362fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Sun, 3 May 2026 22:30:16 +0200 Subject: [PATCH] fix: mockito and OpenJDK warning when running tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Getting warning: Mockito is currently self-attaching to enable the inline-mock-maker. This will no longer work in future releases of the JDK. Please add Mockito as an agent to your build as described in Mockito's documentation: https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3 WARNING: A Java agent has been loaded dynamically (/Users/attila/.m2/repository/net/bytebuddy/byte-buddy-agent/1.17.7/byte-buddy-agent-1.17.7.jar) WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information WARNING: Dynamic loading of agents will be disallowed by default in a future release OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended Signed-off-by: Attila Mészáros --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 16c91ee7df..d207a524d2 100644 --- a/pom.xml +++ b/pom.xml @@ -277,6 +277,7 @@ ${maven-surefire-plugin.version} + -javaagent:${settings.localRepository}/org/mockito/mockito-core/${mokito.version}/mockito-core-${mokito.version}.jar -Xshare:off plain true