当HEAD请求失败时,Gradle无法下载依赖关系 [英] Gradle failing to download dependency when HEAD request fails
问题描述
Gradle无法下载它,并带有错误消息
无法HEAD' https:/ /bitbucket.org/....zip 。收到来自服务器的状态代码403:Forbidden
我研究过它,看起来这是因为:
- Bitbucket重定向到亚马逊网址
- 亚马逊网址不接受HEAD请求,只接受GET请求
我可以通过curl测试该URL来检查,并且在发送带curl的HEAD请求时也得到了403 Forbidden。 b
$ b
否则,可能是因为Amazon不接受HEAD请求中的签名,它应该与GET中的签名不同,如。/ b> 有没有办法解决这个问题?我可以告诉Gradle跳过HEAD请求并直接进入GET请求吗? 我通过使用 I have set up a dependency in my Gradle build script, which is hosted on Bitbucket. Gradle fails to download it, with error message Could not HEAD 'https://bitbucket.org/....zip'. Received status code 403 from server: Forbidden I looked into it, and it seems that this is because : I could check that by testing that URL with curl, and I also got a 403 Forbidden when sending a HEAD request with curl. Otherwise, it could be because Amazon doesn't accept the signature in the HEAD request, which should be different from the GET one, as explained here. Is there a way around this ? Could I tell Gradle to skip the HEAD request, and go straight to the GET request ? I worked around the problem by using the 这篇关于当HEAD请求失败时,Gradle无法下载依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
$ b $ / $ / $> $ / $>
$ b gradle-download-task
插件,并按照此处所述手动编写缓存
gradle-download-task
plugin, and manually writing caching as explained here