Error on TaskOutputUnionFileCollection.setFrom() after upgrade

I’m in the process of upgrading a build environment from 2.x to 5x and I have the following artifact configured:

artifact {
	type = "wls.War"
	name = "${componentName}-${workloadDesignator}-war"
	file = task "renameWar${workloadDesignator.capitalize()}"(type: Copy) {
		from("build/dist/war/${componentName}.war")
		into("${buildDir}/${name}") // build/<task name> directory
		rename { "${componentName}-${workloadDesignator}.war" }
		outputs.files.setFrom("${componentName}-${workloadDesignator}.war")

	}
	properties {
		activateTimeout = "1800000"
		automaticVersioning = "true"
		tags = labels.appTags("service")
		versioned = "true"
	}
}

This all worked fine in 2.x and now I’m getting the following error related to the outputs of the Copy task:

No signature of method: org.gradle.api.internal.tasks.DefaultTaskOutputs$TaskOutputUnionFileCollection.setFrom() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl)

I’ve dug through the source code and tried various ways to get around this but nothing has been successful.