Skip to content

Commit 3106ad1

Browse files
committed
Use Mockito as agent on Java 21+
1 parent 8c22c6b commit 3106ad1

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

pom.xml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
<maven.install.plugin.version>3.1.3</maven.install.plugin.version>
8585
<maven.jar.plugin.version>3.4.2</maven.jar.plugin.version>
8686
<buildnumber.plugin.version>3.2.1</buildnumber.plugin.version>
87+
<maven-dependency-plugin.version>3.8.0</maven-dependency-plugin.version>
8788
<maven.surefire.plugin.version>3.5.0</maven.surefire.plugin.version>
8889
<maven.failsafe.plugin.version>3.5.0</maven.failsafe.plugin.version>
8990
<build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
@@ -277,6 +278,19 @@
277278
</executions>
278279
</plugin>
279280

281+
<plugin>
282+
<groupId>org.apache.maven.plugins</groupId>
283+
<artifactId>maven-dependency-plugin</artifactId>
284+
<version>${maven-dependency-plugin.version}</version>
285+
<executions>
286+
<execution>
287+
<goals>
288+
<goal>properties</goal>
289+
</goals>
290+
</execution>
291+
</executions>
292+
</plugin>
293+
280294
<plugin>
281295
<groupId>org.apache.maven.plugins</groupId>
282296
<artifactId>maven-surefire-plugin</artifactId>
@@ -491,17 +505,25 @@
491505
<mockito.version>4.11.0</mockito.version>
492506
</properties>
493507
</profile>
508+
<profile>
509+
<id>jvm-test-arguments-below-java-21</id>
510+
<activation>
511+
<jdk>[11,21)</jdk>
512+
</activation>
513+
<properties>
514+
<test-arguments>-Xshare:off</test-arguments>
515+
</properties>
516+
</profile>
494517
<profile>
495518
<id>jvm-test-arguments-java-21-and-more</id>
496519
<activation>
497520
<jdk>[21,)</jdk>
498521
</activation>
499522
<properties>
500-
<test-arguments>-XX:+EnableDynamicAgentLoading</test-arguments>
523+
<test-arguments>-Xshare:off -javaagent:${org.mockito:mockito-core:jar}</test-arguments>
501524
</properties>
502525
</profile>
503526

504-
505527
<profile>
506528
<id>extensions</id>
507529
<activation>

0 commit comments

Comments
 (0)