Open Postremus opened 1 week ago
/cc @geoand (testing)
Unfortunately there is nothing we can do at this point to silence the warning without actually addressing the issue at hand (i.e. configuring the mockito agent on the command line). If you want to spend half your day reading up on why the ecosystem arrived at this state, take a look here, it's got tons of great information.
For now, what I propose is doing the following:
maven-dependency-plugin
like so: <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>
</plugin>
Then configure maven-surefire-plugin
like so:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
<argLine>-javaagent:${org.mockito:mockito-core:jar}</argLine>
</configuration>
</plugin>
Note that if you have any plugin that alters the state of the arg line created by surefire (like Jacoco), you need to instead use:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
<argLine>@{argLine} -javaagent:${org.mockito:mockito-core:jar}</argLine>
</configuration>
</plugin>
What we should probably to do on our side @ia3andy (cc @cescoffier @gsmet) is to have our code.quarkus.io
templates (and perhaps our quarkus update
recipes) create the configuration I mentioned above when quarkus-junit5-mockito
is added as a dependency.
Mockito itself has some docs about this.
Having the quickstart and codestart templates and quarkus update
do the tedious maven config is a super idea.
Description
After upgrading to quarkus 3.16.2, I am greeted by this warning from mockito during my quarkus:test run:
I am running on java 21.
Can you please either suppress this warning for now, or automatically fix it?
Implementation ideas
No response