coderatchet
coderatchet

Reputation: 8420

Gradle 'processTestResources' task not copying files

I am new to gradle so this question may be silly, but i have a project configured with the 'java' plugin like so:

apply plugin: 'java'

and it has a file structure like so:

src
`-- test
    |-- java
    |   `-- com/example/Test.java
    `-- resources
        `-- com/example/test.txt

When i run gradlew testClasses (or processTestResources more specifically) the Test.class appears in the build folder but the test.txt does not get copied. am I missing something? my understanding is that this should be standard behaviour. do i need to include it in the CopySpec?

I am running gradle 1.10

Upvotes: 5

Views: 2778

Answers (1)

coderatchet
coderatchet

Reputation: 8420

After a brief look at my build directory for the project, I noticed there is a seperate folder for resources apart from classes. So it is copying there.

from what I understand the resources folder is available on the classpath at runtime, But I was expecting the physical (meta-physically speaking) file to be in the same directory as the Test.class file in my code. hence my question.

Upvotes: 3

Related Questions