gradle zip task exclude files

1down voteaccepted

This is the way to go:

task makeZipDev(type: Zip){
  from 'solr_config/solr_home'
  exclude '**/shop/product/data/**' //exclude 
  archiveName 'solr-home.zip'
  destinationDir(file('/docker/solr-dev/'))
}

or

task makeZipDev(type: Zip){
  from 'solr_config/solr_home'
  excludes = ['**/shop/product/data/**']  //exclude
  archiveName 'solr-home.zip'
  destinationDir(file('docker/solr-dev/'))
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324962197&siteId=291194637