Gradle doesn't download transitive dependencies from local jar

前端 未结 1 1349
轮回少年
轮回少年 2021-01-13 21:39

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

相关标签:
1条回答
  • 2021-01-13 22:29

    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'
    }
    
    0 讨论(0)
提交回复
热议问题