You’re almost there.
You need to declare a custom configuration, using non-standard name, then you need to declare the dependencies of this configuration, and add this configuration in the classpath of your JavaCompile task, ie
configurations{
myConf
}
dependencies {
myConf group:‘de.dfki.mary’, name:‘marytts’, version:‘5.1’
}
task compilePlugin(type: JavaCompile) {
…
classpath=myConf
…
}
Please note that this will only use the dependencies from myConf
You can also do sth like ‘classpath =myConf +sourceSets.main.compileClasspath’ if needed