【问题标题】:Gradle is failing to resolve dependency group:org.apache.httpcomponents, module:httpmimeGradle 无法解析依赖组:org.apache.httpcomponents,模块:httpmime
【发布时间】:2012-09-04 02:19:59
【问题描述】:

我正在编写 java 后端测试用例来检查服务器上的不同 post/get 操作。 我必须使用http post方法上传文件,我使用这个链接作为参考:How to upload a file using Java HttpClient library working with PHP

我在 gradle.build 文件中指定外部依赖 gradle build 无法解析外部依赖 httpmime。

gradle 构建 任务 ':test-fwk:generateClasspath' 执行失败。

无法解析配置 ':test-fwk:default' 的所有依赖项。 找不到组:org.apache.httpcomponents,模块:httpmime,版本:4.1.3

我在 build.gradle 文件中使用编译组:'org.apache.httpcomponents',名称:'httpmime',版本:'4.1.3'。 org.apache.httpcomponents:httpclient 和 httpcore 等其他依赖项正在成功解决。

我花了很多时间试图找到解决方案。如果有人知道这个问题,请回复。

【问题讨论】:

  • 你能发布你的build.gradle吗?
  • 您是否使用 mavenCentral 作为您的存储库?

标签: dependencies gradle


【解决方案1】:

这个最小的构建脚本可以引用 httpmime 依赖,运行 Gradle 1.2

apply plugin: 'java'
repositories{
    mavenCentral()
}
dependencies{
    compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.1.3'
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-24
    • 2015-12-19
    • 1970-01-01
    • 1970-01-01
    • 2018-04-25
    • 2022-01-02
    • 2019-01-27
    • 1970-01-01
    相关资源
    最近更新 更多