Skip to content

Commit 42f5ab4

Browse files
committed
Add Mockito as agent in Java 21+
1 parent 32a40a7 commit 42f5ab4

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<micrometer-tracing-test.version>1.3.4</micrometer-tracing-test.version>
5555
<micrometer-docs-generator.version>1.0.4</micrometer-docs-generator.version>
5656
<maven.compiler.plugin.version>3.13.0</maven.compiler.plugin.version>
57+
<maven.dependency.plugin.version>3.8.0</maven.dependency.plugin.version>
5758
<maven-surefire-plugin.version>3.5.0</maven-surefire-plugin.version>
5859
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
5960
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
@@ -291,6 +292,19 @@
291292
</configuration>
292293
</plugin>
293294

295+
<plugin>
296+
<groupId>org.apache.maven.plugins</groupId>
297+
<artifactId>maven-dependency-plugin</artifactId>
298+
<version>${maven.dependency.plugin.version}</version>
299+
<executions>
300+
<execution>
301+
<goals>
302+
<goal>properties</goal>
303+
</goals>
304+
</execution>
305+
</executions>
306+
</plugin>
307+
294308
<plugin>
295309
<artifactId>maven-surefire-plugin</artifactId>
296310
<version>${maven-surefire-plugin.version}</version>
@@ -579,7 +593,7 @@
579593
<jdk>[21,)</jdk>
580594
</activation>
581595
<properties>
582-
<test-arguments>-Xshare:off -XX:+EnableDynamicAgentLoading</test-arguments>
596+
<test-arguments>-Xshare:off -javaagent:${org.mockito:mockito-core:jar}</test-arguments>
583597
</properties>
584598
</profile>
585599

0 commit comments

Comments
 (0)