I am testing validatePlugins
task from core plugin java-gradle-plugin which seems to be doing nothing during build or if I run it directly.
I have a build script that defined plugins with a nonexisting plugin class. Note foo.bar.NonexistingPluginClass
this class is not in my source code.
plugins {
id 'java-gradle-plugin'
}
gradlePlugin {
plugins {
create("simplePlugin") {
id = "foo.bar.validation-plugin-test"
implementationClass = "foo.bar.NonexistingPluginClass"
}
}
}
Now official Gradle page says following validation is being done:
The implementation-class property references a valid class file in the jar.
Still when I run the build
task which also triggers validatePlugins
one and there are no warnings reported, nothing. Also if I check build/reports/plugin-development/validation-report.txt
the file is just blank.
Instead what I see is that :jar task that gets executed even before validatePlugins is being executed throws a message in the logs as shown below:
> Task :compileJava
> Task :pluginDescriptors
> Task :processResources
> Task :classes
> Task :jar
:jar: A valid plugin descriptor was found for foo.bar.validation-plugin-test.properties but the implementation class foo.bar.NonexistingPluginClass was not found in the jar.
> Task :assemble
>...
> Task :validatePlugins
> Task :check
> Task :build
BUILD SUCCESSFUL in 1s
Am I missing some additional configuration so that I get the warning that the implementationClass is not actually referring to existing class from the validatePlugins task? Or I misinterpreted documentation? Is this a bug?
Using Gradle version 7.2, Java 15