gpt4 book ai didi

gradle - 如何排除资源文件使其不包含在.war中?

转载 作者:行者123 更新时间:2023-12-03 04:21:32 26 4
gpt4 key购买 nike

我有一个小型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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com