[ 
https://issues.apache.org/jira/browse/OAK-11975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18028815#comment-18028815
 ] 

Rishabh Daim commented on OAK-11975:
------------------------------------

We have 3 options:
 # Add JVM arguments to suppress warnings.
{quote}<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>3.0.0</version>
    <configuration>
        <argLine>
            -XX:+EnableDynamicAgentLoading
            -Djdk.instrument.traceUsage=false
        </argLine>
    </configuration>
</plugin>
{quote}
 # Add Mockito as a Java agent.
{quote}<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>3.0.0</version>
    <configuration>
        <argLine>
            
-javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar
        </argLine>
    </configuration>
</plugin>{quote}
 # Use Mockito Extension.
{quote}<dependency>
    <groupId>org.mockito</groupId>
    <artifactId>mockito-junit-jupiter</artifactId>
    <version>5.8.0</version>
    <scope>test</scope>
</dependency>{quote}

> Use Mockito as an agent in Oak
> ------------------------------
>
>                 Key: OAK-11975
>                 URL: https://issues.apache.org/jira/browse/OAK-11975
>             Project: Jackrabbit Oak
>          Issue Type: Task
>            Reporter: Rishabh Daim
>            Assignee: Rishabh Daim
>            Priority: Major
>
> Getting the below warning while running ITs tests in Oak:
> {quote}
> {color:#616161}Mockito is currently self-attaching to enable the 
> inline-mock-maker. This will no longer work in future releases of the JDK. 
> Please add Mockito as an agent to your build as described in Mockito's 
> documentation: 
> https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3{color}
> {color:#616161}WARNING: A Java agent has been loaded dynamically 
> (/Users/diam/.m2/repository/net/bytebuddy/byte-buddy-agent/1.17.7/byte-buddy-agent-1.17.7.jar){color}
> {color:#616161}WARNING: If a serviceability tool is in use, please run with 
> -XX:+EnableDynamicAgentLoading to hide this warning{color}
> {color:#616161}WARNING: If a serviceability tool is not in use, please run 
> with -Djdk.instrument.traceUsage for more information{color}
> {color:#616161}WARNING: Dynamic loading of agents will be disallowed by 
> default in a future release{color}
> {quote}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to