JordanPlayz158
JordanPlayz158

Reputation: 89

Is there any way to force gradle to only use https connections?

So repo1.maven.org doesn't support http anymore so I was wondering if I can force gradle to use https for that website or just all repos, I've tried to many things, squid proxy server to redirect all http requests to repo1.maven.org to https, i've tried setting up nginx to redirect localhost to https://repo1.maven.org and setting repo1.maven.org to localhost in hosts file, etc, etc. Is there any way I could achieve this?

Upvotes: 0

Views: 1185

Answers (1)

Cisco
Cisco

Reputation: 22952

Gradle searches based on how you configured the repositories. Somewhere you have configured a HTTP route somewhere.

Gradle internally uses HTTPS: https://github.com/gradle/gradle/blob/master/subprojects/core-api/src/main/java/org/gradle/api/artifacts/ArtifactRepositoryContainer.java#L52..L53

So you need to update your configurations if you are manually defining repositories anywhere

You may also be using a much outdated version of Gradle. Based on looking at the git history of that file linked above, it was switched to HTTPS in this commit and was released in v2.1.0. Highly suggested you upgrade to supported version of Gradle which is v6.2+

Upvotes: 1

Related Questions