Corporate network is locked down and only allow us to connect to a specific repo (Artifactory). For reasons beyond our control, this is an HTTP only connection. For the repository definition in the build.gradle, this isn’t a problem, we just add the ‘allowInsecureProtocol = true’ flag and all is well.
repositories {
maven {
url "http://123.456.222.222:8081/artifactory/xxx"
metadataSources {
mavenPom()
artifact()
}
credentials {
username = 'xxx'
password = '1234567890'
}
allowInsecureProtocol = true
}
}
The problem comes if we want to use other plugins - say Spring (specified by the "id ‘org.springframework.boot’ version ‘3.2.2’ mechanism.
The default mechanism is to pull the plugins from https://plugins.gradle.org/m2 - but that’s blocked by the network.
So I added the same repository definition to a new pluginManagement section in settings.gradle, however, if I leave the allowInsecureProtocol flag in, Gradle just fails with the error :
Could not set unknown property ‘allowInsecureProtocol’ for repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.
and if you remove it, you get the error :
Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository ‘maven(http://123.456.222.222:8081/artifactory/xxx)’ to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See UrlArtifactRepository - Gradle DSL Version 7.6 for more details.
I’ve tried using both 7.6 and 8.6 with exactly the same results, so how do you specify this flag in a plugin management repository?