How to separate gradle plugin dependencies and project dependencies

This has been discussed before here. There’s a design doc discussing the feature here but as yet there’s no best-practice solution that I’m aware of.

As a workaround, you could create your own configuration in the plugin and create a custom classloader from the jars in the configuration. This custom classloader could then load the conflicting class(es). If using this approach, be careful about the parent classloader so it doesn’t inherit from the buildscript classloader. Classloaders in gradle plugins discussed in @Schalk_Cronje’s idiomatic plugin authoring

2 Likes