我有一个小型Spring / Gradle Liberty Web服务,该服务将部署到多个环境。我想将所有特定于环境的资源从包含该服务的.war中排除。项目结构为:
src/main/java/
src/main/resources
...resources used in all environments
resources/
resources_deployment1
...resources used for deployment1
resources_deployment2
...resources used for deployment2
...
...
我尝试将以下内容放入build.gradle中:
war {
rootSpec.exclude( "resources/**" )
}
但是当我查看部署的.war时,我仍然看到文件
来自
resources/resources_deployment1
。我还能尝试什么?
最佳答案
你有尝试过吗?
war {
rootSpec.exclude("**/resources/**")
rootSpec.exclude("**/resources/**")
}
希望这有效!
你可以引用this
关于gradle - 如何排除资源文件使其不包含在.war中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50239713/