How do I give buildscript access to Ivy API classes post 2.0?

My plugin uses Ivy API classes. Works fine up to Gradle 1.12. Since upgrading from Gradle 1.12 to 2.1 I get CNFE when using this plugin because the plugin no longer has access to the Ivy classes. I can avoid this by explicitly referencing the ivy-.jar file from my buildscript block, but this workaround isn’t acceptable for the project which doesn’t allow automatic downloads of jars or inclusion of ivyjar with the product (it is nearly as large as our main deliverable jar).

Caused by: java.lang.NoClassDefFoundError: org.apache.ivy.core.settings.IvySettings

at com.admc.gradle.Ivyxml.class$(Ivyxml.groovy)

at com.admc.gradle.Ivyxml.$get$$class$org$apache$ivy$core$settings$IvySettings(Ivyxml.groovy)

at com.admc.gradle.Ivyxml.load(Ivyxml.groovy:62)

at com.admc.gradle.Ivyxml$ Source)


at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$

… 31 more

I don’t know how the IvySettings class got into the buildscript path before. How do I get it back?

I tested and see that the same problem occurs with Gradle 2.0 too. I see nothing in the Gradle 2.0 release notes to account for this change in behavior.

This was never an official feature but only an implementation detail, and I’m afraid there is no way to get it back.