Since useAnt has been removed from CompileOptions, what's the best way to compile Java sources relying on internal Sun classes?

I’m compiling some generated Java code that relies on something it probably shouldn’t:

import com.sun.xml.internal.fastinfoset.sax.Properties;

Gradle using Ant knows how to compile this; when relying on the generated ‘build.xml’ the ‘compileJava’ task succeeds. But when I try without Ant: ‘’’ package com.sun.xml.internal.fastinfoset.sax does not exist ‘’’

Searching around I see some old advice to pass the ‘useAnt’ option to the task, but I think that was removed by commit 818e0b9995d930801fd1b7147fec68f37c23cfe7. However some documentation still refers to ‘useAnt’, and I can’t find another way to achieve the same effect.

I understand that this is all deprecated behavior, but since I want to use Gradle for this generated code without modifying it, I think I need to find a way.

Thank you.