I have development related directory src/main/resources/certs/test which is needed for one external library. This has some cert files which are not needed in pr
src/main/resources/certs/test
I had a similar problem with production files in a JAR file (though mine were not test files). I solved it with the following:
jar { exclude ("DIRECTORY-TO-EXCLUDE/**") }
e.g.
jar { exclude ("test/**") }