Fiddling to make Mockito work on modern JVMs.

This commit is contained in:
Michael Bayne
2025-07-10 11:26:18 -07:00
parent 9c0ac56d9e
commit fa13ce785e
+25 -2
View File
@@ -22,19 +22,21 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.12.4</version>
<version>5.18.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<!-- By default, no host whitelist is added to the binary, so it can be used
to download and run applications from any server. To create a custom
Getdown build that can only talk to whitelisted servers, set this
property on the command line, e.g. -Dgetdown.host.whitelist=my.server.com
Wildcards can be used (*.mycompany.com) and multiple values can be
separated by commas (app1.foo.com,app2.bar.com,app3.baz.com). -->
<properties>
<getdown.host.whitelist />
<!-- This is needed for Mockito's agent config shenanigans below. -->
<argLine/>
</properties>
<build>
@@ -126,6 +128,27 @@
<useFile>false</useFile>
</configuration>
</plugin>
<!-- this is needed to set the property in the below argLine config -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{argLine} -javaagent:${org.mockito:mockito-core:jar}</argLine>
</configuration>
</plugin>
</plugins>
</build>