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: {

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
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 ?