You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running mvnup/ApplicabilityTests tests, there is a warning of Mockito that it should be added as an agent.
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 (C:\Users\matth.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
I have reviewed the Mockito agent-loading warning and understand that future JDK versions will restrict dynamic attachment. My plan is to reproduce the warning, update the test execution configuration to add the Mockito/ByteBuddy agent via -javaagent, verify the fix, and submit a focused PR.
Please let me know if there are any additional guidelines before I proceed.
I think that is is surefire responsibility for executing test so should be implemented in surefire
so issue is rather for surefire not for Maven core ...
The issue was caused by using ${org.mockito:mockito-core:jar} in the mockito profile. Since ${...} properties are resolved at POM parse time before dependency:properties runs, the path remained empty.
I resolved this by changing it to use Surefire/Failsafe late-binding interpolation @{org.mockito:mockito-core:jar}, which resolves the path during test execution. I also updated the profile to preserve @{jacocoArgLine} and covered both the Surefire and Failsafe plugins.
Activity
kri-jha commentedon Dec 2, 2025
Hi, I would like to work on this issue.
I have reviewed the Mockito agent-loading warning and understand that future JDK versions will restrict dynamic attachment. My plan is to reproduce the warning, update the test execution configuration to add the Mockito/ByteBuddy agent via -javaagent, verify the fix, and submit a focused PR.
Please let me know if there are any additional guidelines before I proceed.
Thank you!
assokhi commentedon Mar 15, 2026
@kri-jha Are you still working on this? If not, I'd love to pick this up and submit a PR.
slawekjaranowski commentedon Mar 15, 2026
@Bukama @gnodet where should it be implemented?
I think that is is surefire responsibility for executing test so should be implemented in surefire
so issue is rather for surefire not for Maven core ...
Hiteshsai007 commentedon Jun 25, 2026
The issue was caused by using
${org.mockito:mockito-core:jar}in themockitoprofile. Since${...}properties are resolved at POM parse time beforedependency:propertiesruns, the path remained empty.I resolved this by changing it to use Surefire/Failsafe late-binding interpolation
@{org.mockito:mockito-core:jar}, which resolves the path during test execution. I also updated the profile to preserve@{jacocoArgLine}and covered both the Surefire and Failsafe plugins.[#11449] Fix Mockito agent: use late binding @{} interpolation and ex…
[#11449] Fix Mockito agent: use late binding @{} interpolation and ex…