Gradle jCenter 替代或镜像



我的服务器无法连接到jcenter(Amazon Cloud(。 我可以指定替代的 jcenter 服务器吗?

20:

23:17 :微服务包装器:未指定>org.akhikhl.gretty:gretty:2.0.0 20:23:17> 无法解析 org.springframework.boot:spring-boot-loader-tools:1.5.4.RELEASE. 20:23:17> 无法获取资源 "https://jcenter.bintray.com/org/springframework/boot/spring-boot-loader-tools/1.5.4.RELEASE/spring-boot-loader-tools-1.5.4.RELEASE.pom"。 20:23:17> 无法头 "https://jcenter.bintray.com/org/springframework/boot/spring-boot-loader-tools/1.5.4.RELEASE/spring-boot-loader-tools-1.5.4.RELEASE.pom"。 20:23:17> 连接到 repo.jfrog.org:443 [repo.jfrog.org/34.227.55.218, repo.jfrog.org/34.200.155.151] 失败: 连接被拒绝(连接被拒绝( 20:23:17> 无法 resolve org.springframework.boot:spring-boot-devtools:1.3.3.RELEASE.

是的,您可以按照 Gradle 文档中的说明配置自定义存储库。请记住,jcenter 是 maven 存储库类型。如果要提供自定义 maven 存储库,可以通过以下方式定义其 URL:

repositories {
maven {
url "http://repo.mycompany.com/maven2"
}
}

jcenter 的替代方案也在 Gradle 文档中进行了描述,例如:mavenCentral()。此外,这个和这个类似的答案说明了如何实现预期的行为。

最新更新