【问题标题】:Excluding a Grails build scope dependency排除 Grails 构建范围依赖项
【发布时间】:2014-12-02 20:50:02
【问题描述】:

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

示例

Grails 与库spock-core-0.7-groovy-2.0.jar 捆绑在一起;添加标准全局依赖排除时:
...
grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits('global') {
        excludes 'spock-core'
    }
...

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

【问题讨论】:

    标签: grails build dependencies


    【解决方案1】:

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

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

    【讨论】:

    • 不,不只是在战争中;跨越所有范围
    猜你喜欢
    • 1970-01-01
    • 2015-09-29
    • 2012-11-14
    • 2016-06-11
    • 2023-03-04
    • 1970-01-01
    • 1970-01-01
    • 2017-03-15
    • 2012-11-03
    相关资源
    最近更新 更多