问题描述
我有一个外部库需要的开发相关目录 src / main / resources / certs / test
。这有一些在生产版本中不需要的证书文件。
目前,我将该目录下的所有内容都排除在 build.gradle
:
sourceSets {
main {
资源{
排除'** / test / *'
}
}
}
这样做效果不错,但在那里留下丑陋的空目录 test
。我的选择不包括这个目录在最后的战争?
我试过排除'** / test'
,但它根本不起作用。
我使用war插件和Gradle 1.2
apply plugin:'war'
sourceSets {
main {
资源{
排除'** / test / *'
排除'certs / test'
}
I have development related directory src/main/resources/certs/test
which is needed for one external library. This has some cert files which are not needed in production build.
At the moment I exclude everything under that directory with following block in build.gradle
:
sourceSets {
main {
resources {
exclude '**/test/*'
}
}
}
This does it job well, but leaves ugly empty directory test
lying there. What are my options to not include this directory in final war?
I've tried excluding '**/test'
, but it doesn't work at all.
I use war plugin and Gradle 1.2
Using Gradle 1.1, this works for me:
apply plugin: 'war'
sourceSets {
main {
resources {
exclude '**/test/*'
exclude 'certs/test'
}
}
}
这篇关于Gradle 1.2:排除资源sourceSets下的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!