How to exclude files from distZip using Gradle?

前端 未结 3 940
醉话见心
醉话见心 2021-01-01 19:32

I am using Gradle 1.3 and have it working for a small project. It creates the .JAR files exactly as I want them to. However, when I have it create a ZIP file using distZip

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-01 20:27

    The application plugin provides a configuration element applicationDistribution, which allows you to exclude specific things from the distribution targets, e.g.:

    applicationDistribution.exclude('foo*.jar')
    

    or if you'd like to exclude several things, you can use a Groovy with block:

    applicationDistribution.with {
        exclude 'foo*.jar'
        exclude 'bar*.jar'
    }
    

提交回复
热议问题