【发布时间】: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