I would remove the plugin() method and rely on Gradle's inferencing instead. It's error prone to rely on the plugin to make sure it consistently uses this. Gradle already knows the plugin, along with its version, how it was applied (it might not be by id or have an id), who applied it, etc.