Hallo All,
the files under src/main/ressouces from my plugin are not included in the main.jar, which is created by the GradleRunner. So some plugin tests fail because the task under test tries to get some files from the main.jar using the zipTree function.
How can I include them into the .jar?
sorry for the typo. I ment src/main/resources. It’s available in the GradleRunner.pluginClasspath() but I need it in the jar in order to run the test successfully
Ah, now I understand what you mean.
I’d like to suggest to instead just get the file as resource instead of unzipping a jar file.
This would be cleaner and also fix the issue you have.
If you insist on extracting the jar, you probably need to either use withPluginClasspath with arguments, giving the actual classpath to inject, or configure the pluginClasspath property on the pluginUnderTestMetadata task accordingly, or not use withPluginClasspath at all but instead publish to some local repository (not maven local) and consume the plugin in the tests from there.