Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle 'processTestResources' task not copying files

Tags:

gradle

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

like image 824
coderatchet Avatar asked Oct 20 '22 16:10

coderatchet


1 Answers

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.

like image 173
coderatchet Avatar answered Oct 24 '22 00:10

coderatchet