When you apply
java-gradle-plugin it automatically creates a
plugin-under-test-metadata.properties file with the appropriate classpath for use with testkit.
The problem is, that classpath doesn’t include
build/libs/myplugin.jar, instead it includes
build/resources/main. This means that it isn’t a true functional test - if there’s a problem in the “jar” step, it doesn’t get caught. It also makes it hard to test a plugin which can’t run without special packaging (e.g. a plugin which is also an OSGi bundle).
I guess the reason for
pluginUnderTestMetadata to depend on
classes rather than
assemble is largely a performance optimization. But for me, the time to assemble the jar is much faster than the startup time for testkit. It would be great if there was an easy way to test the final build output, rather than just the folder of class files.