How to Exclude directory and its contents in gradle war

前端 未结 4 1030
醉话见心
醉话见心 2021-01-15 03:43

I am using gradle war plugin, I am trying to exclude some directories inside WEB-INF directory while packing a war, but the excludes don\'t seem to

4条回答
  •  长发绾君心
    2021-01-15 03:51

    To exclude a folder named metadata contained in WEB-INF use the following code in your build.gradle file:

    war.rootSpec.exclude("**/WEB-INF/metadata/")
    

    or depending on your coding style you could also use:

    war 
    { 
        rootSpec.exclude("**/WEB-INF/metadata/") 
    }
    

    This link on the gradle discussion forum may also be of help

提交回复
热议问题