This is an automated email from the ASF dual-hosted git repository.

dan-s1 pushed a commit to branch NIFI-15999
in repository https://gitbox.apache.org/repos/asf/nifi-api.git

commit 04b305f150de8690d15b3cf1a2e75af1e378bbf8
Author: dan-s1 <[email protected]>
AuthorDate: Wed Jun 10 14:56:19 2026 +0000

    NIFI-15999 Added Mockito as an agent to thereby not have Mockito 
self-attach to enable the inline-mock-maker.
---
 pom.xml | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/pom.xml b/pom.xml
index df48eb6..810859b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,6 +85,8 @@
         <mockito.version>5.23.0</mockito.version>
         <pmd.version>7.23.0</pmd.version>
         <swagger-annotations.version>2.2.46</swagger-annotations.version>
+        <!-- Define empty argLine to prevent possible Maven crash during 
Mockito instrumentation -->
+        <argLine/>
     </properties>
 
     <dependencyManagement>
@@ -178,6 +180,33 @@
             </plugins>
         </pluginManagement>
         <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>get-mockito-agent</id>
+                        <phase>initialize</phase>
+                        <goals>
+                            <!--
+                            Automatically sets a project property for every 
direct and transitive dependency that points
+                             directly to its resolved artifact file on the 
local file system
+                            -->
+                            <goal>properties</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <!-- @{argLine} preserves any arguments generated by other 
plugins hence
+                    ${org.mockito:mockito-core:jar} is resolved after 
executing maven-dependency-plugin
+                    with the properties goal-->
+                    <argLine>@{argLine} 
-javaagent:${org.mockito:mockito-core:jar}</argLine>
+                </configuration>
+            </plugin>
             <plugin>
                 <groupId>org.apache.rat</groupId>
                 <artifactId>apache-rat-plugin</artifactId>

Reply via email to