Reputation: 1899
For my integration test automation with Gradle I need to copy the library directory into the directory where my Dockerfile resides to generate the docker image. I am doing this:
task copyRuntimeLibsToLocal(type: Copy) {
group = 'docker'
dependsOn 'build'
from (configurations.compileOnly){
exclude 'ehcache*.jar'
}
into "/MYDOCKERDIR/dependenciesLibraryDir"
}
But how can I make sure that old jars in dependenciesLibrary are deleted?
Upvotes: 1
Views: 516
Reputation: 38734
Use type: Sync
instead of type: Copy
. They are the same except that Sync
additionally removes files that are present in the destination directory and are not copied.
Upvotes: 4