Gradle - Error Copying Files To Project Root


(Scott Serven) #1

I’m getting the following error whenever I attempt to use a Copy task to copy a file into the root of a project (the same folder I’m running gradle from):

Failed to create MD5 hash for file content.

I thought this was related to the artifacts I was pulling from Artifactory, but that seems to be unrelated. I was able to get the same results with a minimal script.

Is there something obviously wrong with what I’m doing, or does Gradle intentionally disallow such things?

task fails(type:Copy) {
    from 'build/someFile.txt'
    into new File('.').absolutePath
}

task works(type:Copy) {
    from 'build/someFile.txt'
    into new File('.').absolutePath + '/output'
}