Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle doesn't download transitive dependencies from local jar

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

Can Gradle take the transitive dependencies from there?

like image 436
Óscar Avatar asked Jan 28 '23 05:01

Óscar


1 Answers

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

Eg:

$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

repositories {
    maven {
        url = file('local-repo')
    }
}
dependencies {
    compile 'com.foo:bar:1.0'
}
like image 98
lance-java Avatar answered Jan 31 '23 19:01

lance-java