Custom charset cannot be used in Gradle

I am in the process of writing some plugins that will enable us to functionally replace apache ant as a build tool. The ant build used a custom Charset.
I have replicated that Charset in a single jar, but however I try with dependencies, and trying to get the jar on the daemons classpath etc, I cannot get the Charset to be recognised… If I access the charset with the jar on the classpath in a simple java program, the charset is found.
Open to suggestions,