gradlew getting 403 on fetching gradle binary
Asked Answered
H

1

5

I'm kind of stuck troubleshooting an issue.

  • During a Jenkins build I see the following error:

    Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: http://services.gradle.org/distributions/gradle-1.7-bin.zip

  • This also happens when I run ./gradlew clena build in my project in localhost (no VPN, etc)

  • It does NOT happen when I paste the binary URL into my browser (so that old gradle version does exist)

Binary referenced in gradel-wrapper.properties:

distributionUrl=http\://services.gradle.org/distributions/gradle-1.7-bin.zip

Any ideas?

Honeybunch answered 16/3, 2020 at 16:19 Comment(3)
If I try to access services.gradle.org/distributions/gradle-1.7-bin.zip, I get Couldflare 1020, which inficates a firewall rule has been violated. It seems like there is a server-side problem...Bally
Oh, it works with HTTPS but not with HTTP. It seems that a firewall blocks port 80 but allows 443...Bally
@Bally good catch! That resolved the 403 locally :) I'll update gradel-wrapper.properties accordingly. Appreciate it!Honeybunch
C
10

Comments have pointed you to answer, but to clarify with more information and references.

Gradle announced on October 17, 2019, that starting on Janurary 2020, all Gradle services will no longer serve requests made with HTTP.

The URL you have specified for in gradle-wrapper.properties is for HTTP, switch to the HTTPS URL and it should work.

Reference: https://blog.gradle.org/decommissioning-http

Coyle answered 16/3, 2020 at 19:15 Comment(1)
Ok, thank you for clearing up the background on that Francisco!Honeybunch

© 2022 - 2024 — McMap. All rights reserved.