processResources not working same way in 1.7 compared to 1.10


(ignace.martin) #1

I have overwitten processResources in my build script in order to get all resources stored in the “resources” subdirectory in the created jar.

processResources {
    from "$projectDir/src/main/resources"
    into "$destinationDir/resources"
}

In gradle 1.7 it was working fine. Now trying gradle 1.10, the resources are copied in the destinationDir directory and I find them in the root directory in the jar.


(c2665466) #2

Try this:

processResources {
    destinationDir = file(sourceSets.main.output.classesDir.getPath() + "/resources")
}

Maybe there’s a more elegant way to describe the path, but modifying the destinationDir property should be the correct way of achieving what you want.


(ignace.martin) #3

Thanks! It works better like this!