Hello,

I'm Moritz, working in the Spring Team on start.spring.io. We have an issue
about a warning that gets printed when using Mockito on JDK 21 or above (
https://github.com/spring-io/initializr/issues/1590):

WARNING: A Java agent has been loaded dynamically
(/home/mhalbritter/.m2/repository/net/bytebuddy/byte-buddy-agent/1.15.11/byte-buddy-agent-1.15.11.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

The recommended fix for that is documented in the Mockito docs (
https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#0.3),
and it involves modifying the "argLine" configuration of the
maven-surefire-plugin plugin.

Are there any plans to automatically detect the use of bytebuddy (or more
generally the use of agents) on Maven side and automatically configure
surefire to do the right thing or are users expected to modify their build
themselves?

Thanks,
Moritz

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.

Reply via email to