Running test on Java 6 with gradle 6.0.1 emit warning about multiple ant versions

I’m compiling and testing my project with Java 6 even though I’m running latest gradle 6.0.1 on JVM 1.8. I’ve implemented something similar to this example in the documentation, the only thing is that I’m using ant integration, defining an ant task inside gradle in this way :

ant.mytest(haltonfailure: false, fork: true, forkmode: 'once', jvm: javaExecutables.java) {

but since I have to use ant version 1.9.x( because newer ant version 1.10.x are not compatible with java 6), i’m getting now this warning:

WARNING: multiple versions of ant detected in path for junit
jar:file:/home/ale/.gradle/wrapper/dists/gradle-6.0.1-bin/1lxlpkiy24sb18odw96cp4ojv/gradle-6.0.1/lib/ant-1.10.7.jar!/org/apache/tools/ant/Project.class
and jar:file:/home/ale/dev/common/lib/unittest/randomizedtesting-runner/ant-1.9.14.jar!/org/apache/tools/ant/Project.class

Is there a way to avoid loading the gradle wrapper dependency version of ant to be part of my ant task runner ? Any other way to avoid the warning ?