Gradle: How to exclude a particular package from a jar?

后端 未结 3 440
甜味超标
甜味超标 2020-12-01 12:56

We have a package that is related to some requirements that were removed, but we don\'t want to necessarily delete the code because there\'s a possibility it will be needed

3条回答
  •  Happy的楠姐
    2020-12-01 13:13

    This solution is valid if you don´t want to compile these packages, but if you want to compile them and exclude from your JAR you could use

    // tag::jar[]
    jar {
        exclude('mi/package/excluded/**')   
        exclude('mi/package/excluded2/**')  
    }
    // end::jar[]
    

提交回复
热议问题