gpt4 book ai didi

grails - 排除 Grails 构建范围依赖项

转载 作者:行者123 更新时间:2023-12-04 16:09:16 24 4
gpt4 key购买 nike

使用 Grails 2.4.3,如何排除 build 中定义的依赖项范围?

ExampleGrails 与库 spock-core-0.7-groovy-2.0.jar 捆绑在一起;添加标准全局依赖项排除时:

...
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits('global') {
excludes 'spock-core'
}
...

除了 build 之外,Spock 被排除在所有依赖范围之外。范围。

最佳答案

问题是您不希望它出现在 .war 文件中吗?如果是这样,您可以像这样删除它:

grails.war.resources = { stagingDir ->
delete(file:"${stagingDir}/WEB-INF/lib/spock-core-0.7-groovy-2.0.jar")
}

关于grails - 排除 Grails 构建范围依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26252744/

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