英文:
gradle download artifact version as given
问题
在我的Gradle项目中,存在对库的19.6.0-rel.1版本的依赖。实际上,该JAR文件可在项目的Maven仓库中找到,但maven-metadata.xml中缺少版本详细信息。据我所理解,Gradle会将上述提到的版本解释为快照版本或其他内容,因此会检查maven-metadata.xml。
如何强制Gradle下载该精确版本并忽略maven-metadata.xml?
(请注意,由于这是第三方库,我无法更改其版本。)
英文:
In my gradle project, there is dependency to version 19.6.0-rel.1 of a library. The jar is actually available in project's maven repository, but the version details are missing in maven-metadata.xml. As I understood, gradle interprets the version mentioned above as as a snapshot version or something and hence checks the maven-metadata.xml.
How can I force gradle to download that exact version and to ignore maven-metadata.xml?
(Note that I cannot change the version of the library as its 3rd party.)
答案1
得分: 0
最终我选择了更高版本的库。
但是后来我发现了如何在这里使用Gradle指定精确的依赖版本,文档链接:https://docs.gradle.org/current/userguide/single_versions.html。
implementation("org.slf4j:slf4j-api") {
version {
strictly '1.7.15'
}
}
英文:
In the end I went ahead with a higher version of the library.
But I later found how to specify exact dependency version with Gradle here https://docs.gradle.org/current/userguide/single_versions.html.
implementation("org.slf4j:slf4j-api") {
version {
strictly '1.7.15'
}
}
专注分享java语言的经验与见解,让所有开发者获益!
评论