Hello,
I am using Gradle 7.5.1 and I have the following repositories section in my build.gradle file (one section is inside the buildscript section, while the other one is at the same level with buildscript). The repositories are hosted by my company internally, and they are over http (NOT https), therefore I have used the allowInsecureProtocol flag:
buildscript {
repositories {
maven {
url "<http url>"
allowInsecureProtocol = true
}
}
}
repositories {
maven {
url "<http url>"
allowInsecureProtocol = true
}
I run ./buildew clean assemble and the build fails with the below error, related to the second repositories section. It’s as if the flag allowInsecureProtocol is completely ignored:
* What went wrong:
A problem occurred evaluating root project 'opensearch_security'.
> repository [maven] on project with path [:] is not using a secure protocol for artifacts on [<http url>]
If I remove the flag from the first repositories section, the error is different to the first one, so I guess that different mechanisms are used to check the flag for the 2 sections (and maybe this is where my issue comes from):
* What went wrong:
A problem occurred configuring root project 'opensearch_security'.
> Could not resolve all dependencies for configuration ':classpath'.
> Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(<http url>)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols.
Any ideas as to why the flag is not taken in the second repositories section and what I could do to finish my build succesfully?
Thanks.
Alex