【问题标题】:Cannot exclude httpcomponents jar from Grails application无法从 Grails 应用程序中排除 httpcomponents jar
【发布时间】:2014-08-31 17:12:44
【问题描述】:

我正在尝试通过排除 httpclient-4.3.1.jar 而包括 httpclient-4.3.2.jar 来解决我的 Grails 应用程序中的 this issue。

我设法包含了 4.3.2,但我的问题是我无法真正理解为什么包含 4.3.1。我已经运行了grails dependency-report,但这只是显示版本 4.1.2 包含在几个不同的插件中。 4.3.1 似乎包含在“根”级别,如下所示:

...
+--- org.apache.httpcomponents:httpclient:4.3.1
...

我尝试在BuildConfig.groovy 的dependencies 块中添加一些excludes 行:

excludes 'org.apache.httpcomponents:httpcore:4.3.1'
excludes 'org.apache.httpcomponents:httpclient:4.3.1'

但我不确定这是否是有效的语法。如何排除这个版本的httpclient jar?

编辑:

我还尝试将这些依赖项的excludes 添加到BuildConfig.groovy 中的global 块中:

inherits("global") {
    excludes 'org.apache.httpcomponents:httpcore:4.3.1', 'org.apache.httpcomponents:httpclient:4.3.1'
}

还有这个:

inherits("global") {
    excludes 'httpcore:4.3.1', 'httpclient:4.3.1'
}

但这似乎也不起作用。

【问题讨论】:

    标签: grails dependencies ivy apache-httpclient-4.x


    【解决方案1】:


    "org.apache.httpcomponents:httpclient:4.3.1" 似乎是一个默认的 grails 依赖项,因此它应该被排除在 inherits("global") BuildConfig 的块中,而不是在依赖项中。

    【讨论】:

    • 感谢您的回答.. 这似乎也不起作用。我已经更新了我的问题以显示我尝试过的内容。
    猜你喜欢
    • 1970-01-01
    • 2013-06-21
    • 2015-09-29
    • 1970-01-01
    • 1970-01-01
    • 2016-01-20
    • 2018-02-14
    • 2013-11-03
    • 1970-01-01
    相关资源
    最近更新 更多