Can't change output dir for resources

plugins {
	id 'java'

sourceSets {
    def resourcesSubDir = new File("${sourceSets.main.output.resourcesDir}/modules/${name}")
	custom {
		java.destinationDirectory.fileValue resourcesSubDir
		resources.destinationDirectory.fileValue resourcesSubDir
	def allTasks = ['compileCustomJava', 'processCustomResources']
	tasks.findAll { in allTasks }*.configure {
		// setDestinationDir has no effect as well
		destinationDir = resourcesSubDir
		println destinationDir

output is


neither changing sourceSets.custom.resources.destinationDirectory, nor setting destinationDir on the task has any effect. How can I change the output dir for these resources?