processResources not working same way in 1.7 compared to 1.10

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.

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.

Thanks! It works better like this!