Gradle not including dependencies in published pom.xml

前端 未结 7 1956
囚心锁ツ
囚心锁ツ 2020-12-02 06:26

I have a Gradle project I\'m using the maven-publisher plugin to install my android library to maven local and a maven repo.

That works, but the g

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 07:12

    With gradle 3 implemention was introduced. Replace compile with implementation. Use this instead.

    pom.withXml {
        def dependenciesNode = asNode().appendNode('dependencies')
        configurations.implementation.allDependencies.each {
            def dependencyNode = dependenciesNode.appendNode('dependency')
            dependencyNode.appendNode('groupId', it.group)
            dependencyNode.appendNode('artifactId', it.name)
            dependencyNode.appendNode('version', it.version)
        }
    }
    

提交回复
热议问题