Problem with outdated version of snakeyaml

I want to create a Gradle plugin that depends on snakeyaml. The version shipped with gradle-1.8 is 1.6 and I would prefer to work with a more recent version.

Is there any plan to upgrade the library to a more recent version (I think it is included because of testng)

or is there another way to solve this problem?

Your plugin could resolve its own version of the library using a custom configuration. When your plugin uses the library assigned to the configuration you might want to load its classes with a thread context classloader. That’ll ensure that the classloader only uses the classes from your configuration and not the snakeyaml classes provided by the Gradle runtime.

Thanks Benjamin for your answer. It’s really appreciated.

I dig a little bit more and it’s already at compile time (in the buildSrc project) that the problem occurs (I was previously working within an IDE, where everything works)

It seems that the problem is the gradleApi() that is included as a compile dependency. And there is a bug http://issues.gradle.org/browse/GRADLE-1715 related to that very problem.

One solution I will try is to split the plugin’s code to build the part that needs the newer version as a separate project and use the plugin classloader isolation at runtime.