【问题标题】:Ant is downloading transitive dependencies from http instead of httpsAnt 正在从 http 而不是 https 下载传递依赖项
【发布时间】:2020-05-14 04:56:24
【问题描述】:

我承认我并不精通 Ant。显然,第一个工件似乎确实认识到了 https 的使用,但传递依赖却没有。 我猜当 1 月 15 日 maven central 从 http 更改为 https 时,maven-ant-tasks-2.1.3 中的某些内容并没有改变。

20:16:26 ant-task-download:
20:16:27       [get] Getting: https://repo1.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar
20:16:27       [get] To: /root/workspace/src/apache/hadoop/release_0.20.2+737/ivy/maven-ant-tasks-2.1.3.jar
20:16:27 
20:16:27 mvn-taskdef:
20:16:30 [artifact:dependencies] [INFO] artifact joda-time:joda-time: checking for updates from company-releases
20:16:30 [artifact:dependencies] [INFO] artifact joda-time:joda-time: checking for updates from company-snapshots
20:16:30 [artifact:dependencies] [INFO] artifact joda-time:joda-time: checking for updates from internal
20:16:30 [artifact:dependencies] [INFO] artifact joda-time:joda-time: checking for updates from central
20:16:30 [artifact:dependencies] [WARNING] repository metadata for: 'artifact joda-time:joda-time' could not be retrieved from repository: central due to an error: Error transferring file: Server returned HTTP response code: 501 for URL: http://repo1.maven.org/maven2/joda-time/joda-time/maven-metadata.xml
20:16:30 [artifact:dependencies] [INFO] Repository 'central' will be blacklisted
20:16:30 

https://repo1.maven.org/...”joda-time URL 确实存在。是否有解决此问题或将下载设置为使用 https URL 的方法?

【问题讨论】:

  • 使用 Ant 有充分的理由吗?我建议改用 Maven...?
  • 是的。如果可以选择,我会使用 Gradle 而不是 Maven,或者更好的是我会使用 Bazel。
  • Ant 本身不是这里的问题;它是 maven-ant-tasks 库。它已经退役多年了。请参阅他们主页上的消息:maven.apache.org/ant-tasks/index.html。作为一个简单的解决方法,您可以直接将 mvn 命令与 Ant 的 exec 任务一起使用。
  • @user2569618 小心使用 Bazel。这是一个几乎没有市场份额的小众产品。

标签: maven ant maven-central


【解决方案1】:

我遇到了同样的问题。最后我通过手动下载我需要的所有依赖项解决了我的问题(将依赖项写入新的pom并使用最新版本的maven下载),这样可以避免从不推荐使用的http源下载ant驱动。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-20
    • 2016-10-28
    • 1970-01-01
    • 2021-06-04
    • 2016-07-28
    • 1970-01-01
    • 2020-06-03
    相关资源
    最近更新 更多