Gradle不会从本地jar下载可传递依赖项 [英] Gradle doesn't download transitive dependencies from local jar
本文介绍了Gradle不会从本地jar下载可传递依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在本地有一个依赖项,但是Gradle似乎并没有采用 META-INF/maven/.../pom.xml
I have a dependency locally but Gradle does not seem to take the transitive dependencies found in the pom located in META-INF/maven/.../pom.xml
Gradle可以从那里获取传递依赖吗?
Can Gradle take the transitive dependencies from there?
推荐答案
If you are hosting the jars in a local folder you will need to adhere to the Maven repository directory conventions and store the pom alongside the jar. Neither gradle nor maven will read a pom.xml zipped inside the META-INF
directory of a jar
例如:
$projectDir/local-repo/com/foo/bar/1.0/bar-1.0.jar
$projectDir/local-repo/com/foo/bar/1.0/bar-1.0.pom
build.gradle
build.gradle
repositories {
maven {
url = file('local-repo')
}
}
dependencies {
compile 'com.foo:bar:1.0'
}
这篇关于Gradle不会从本地jar下载可传递依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文