建了个私仓测试是用http://开头请求,结果构建时报了下面错误:
Using insecure protocols with repositories, without explicit opt-in, is unsupported.
Switch Maven repository 'maven(http://xxx.xxx.xxx/repository/public/)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols.
See https://docs.gradle.org/7.4.1/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.
看报错是因为使用vpn不安全连接下载依赖,需要在maven里添加参数才可以访问http地址。
maven {
allowInsecureProtocol = true
url 'http://xxx.xxx.xxx/repository/public/'
}
在此记录一下
文章讲述了在构建过程中遇到Gradle报错,不允许使用不安全的HTTP协议来请求私有仓库。解决方案是在Maven配置中添加allowInsecureProtocol参数,设置为true,从而允许HTTP协议连接。
2万+

被折叠的 条评论
为什么被折叠?



