Carsten Ziegeler created SLING-13411:
----------------------------------------

             Summary: Explicitely setting agent for mockito
                 Key: SLING-13411
                 URL: https://issues.apache.org/jira/browse/SLING-13411
             Project: Sling
          Issue Type: Improvement
          Components: General
            Reporter: Carsten Ziegeler
             Fix For: Parent 67


When using mockito with Java 21+ , the agent should be expclictely set: 
https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3

We could do this by adding the below to the parent pom:
{code:java}
+            <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>-javaagent:${org.mockito:mockito-core:jar}</argLine>
+                </configuration>
+            </plugin>{code}
 

 



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to