How to add a folder to the test runtime resources

Hi all,

TL:DR
How can I add the folder “WEB-INF/classes” to the test runtime resources folders in Gradle 4.10?

Adding it to the sourceSet.test.resources.srcDirs does not work, as this copies the files into the resources/test folder, which doesn’t work for the product we use. Long explanation for this: see below.

Longer explanation:

We work with a product that strictly requires us to place a properties file into the WEB-INF/classes folder of the products web application. There is no way we can put it anywhere else at runtime.

With our own Java code, we add features and customisations to that web application and we also write system- & unit-tests for our code.

To run the system-tests in gradle the products application code must be able to locate the properties file in exactly this folder “WEB-INF/classes” otherwise the application does not work.

Our problem is that when we run the tests, we include the “WEB-INF/classes” folder in the classpath, but it seems that the properties file is not visible at runtime (probably as it is not a class but a resource).

Putting the file into the “build/resources/test/” folder for test execution makes the file visible to the application, but as it is in the wrong location, the application does not work properly. :frowning:

How can I add the folder “WEB-INF/classes” (or the properties file in that folder) to the test runtime resources folders?

I didn’t find anything on gradle.org nor on stackoverflow.com :frowning:

Your help is highly appreciated!