【发布时间】:2019-10-04 15:09:04
【问题描述】:
我试图通过 mvn 获取依赖关系,但问题是其中一个包不在官方 repo 中。我已经设法将 jcenter 添加到源中,但 maven 似乎不适合在那里查看。
这里正确地寻找下一个回购
Downloading from central: https://repo.maven.apache.org/maven2/io/ktor/ktor-client-core/1.2.5/ktor-client-core-1.2.5.pom
Downloading from central: https://jcenter.bintray.com/io/ktor/ktor-client-core/1.2.5/ktor-client-core-1.2.5.pom
但这里没有:
Downloading from central: https://repo.maven.apache.org/maven2/io/ktor/ktor-http/1.2.5/ktor-http-1.2.5.pom
[WARNING] Missing POM for io.ktor:ktor-http:jar:1.2.5
mvn -Dartifact=io.ktor:ktor-client-core:1.2.5 -DremoteRepositories=central::default::https://jcenter.bintray.com/ dependency:get
【问题讨论】:
-
虽然我看到您决定从 Maven 切换到 Gradle,但如果您要继续使用 Gradle,然后使用 JCenter 存储库,您只需要在构建文件中添加
repositories { jcenter() }。