I’ve been quickly developing a small plugin to use for a few projects, but I’m running into an interesting case that I’ve just been banging my head against for hours. I’m sure the issue is extremely simple, but I haven’t found it yet.
The plugin in question: GitHub - Michionlion/gradle-cache-dependencies
Although applying that plugin in its own build.gradle
works just fine, I get the following error after publishing it to the plugin portal and using it from a different project:
* What went wrong:
Could not apply requested plugin [id: 'com.wagner.cache-dependencies', version: '0.1.0'] as it does not provide a plugin with id 'com.wagner.cache-dependencies'. This is caused by an incorrect plugin implementation. Please contact the plugin author(s).
> Plugin with id 'com.wagner.cache-dependencies' not found.
The gradlePlugins block pretty clearly does define a plugin with the id com.wagner.cache-dependencies
:
gradlePlugin {
plugins {
cacheDependencies {
id = "com.wagner.cache-dependencies"
displayName = "Cache Dependencies"
description = "Adds tasks to enable caching your dependencies in various ways"
implementationClass = "com.wagner.cache_dependencies.CacheDependenciesPlugin"
}
}
}
Is there something basic I’m missing here? At first I believed it was the hyphen in the name, however my configuration appears essentially identical to many other plugins currently published on the portal with hyphens in their name. I can also publish the plugin to my local maven repo (with gradle publishToMavenLocal
and then pull that in to a different project if the following is in settings.gradle
and everything works.
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
}
I’d appreciate any pointers at all!