The previous approach didn't work because Gradle wraps the copy() result, and the leakage didn't go away.