>无法将withXml()应用于生成的POM>无法获取未知属性“实现”

时间:2019-07-24 15:51:51

标签: android gradle bintray

我正在尝试将Android库发布到Bintray。而且我在bintray和android项目中都进行了设置。我用于bintray上传设置 publish.gradle 的项目gradle文件如下:

apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'

version '1.0'
group 'np.com.ngimasherpa'

publishing {
    publications {
        Production(MavenPublication) {
            artifact("$buildDir/outputs/aar/emptyviewsupportrecyclerview-release.aar") 
            groupId this.group
            artifactId 'emptyviewsupportrecyclerview'
            version this.version

            pom.withXml {
                def dependenciesNode = asNode().appendNode('dependencies')

                configurations.implementation.allDependencies.each {

                    if (it.name != 'unspecified') {
                        def dependencyNode = dependenciesNode.appendNode('dependency')
                        dependencyNode.appendNode('groupId', it.group)
                        dependencyNode.appendNode('artifactId', it.name)
                        dependencyNode.appendNode('version', it.version)
                    }
                }
            }
        }
    }
}

bintray {
    user = project.hasProperty('user') ?: System.getenv('BINTRAY_USER')
    key = project.hasProperty('apiKey') ?: System.getenv('BINTRAY_API_KEY')
    publications = ['Production']
    configurations = ['archives']
    dryRun = false
    override = false
    publish = true
    pkg {
        repo = 'EmptySupportRecyclerView' 
        name = 'np.com.ngimasherpa.emptyviewsupportrecyclerview' 
        version {
            name = this.version
            released = new Date()
            vcsTag = this.version
        }
    }
}
  

,并且尝试使用gradle命令./gradlew上传库时   bintrayUpload它给出以下错误:

Execution failed for task ':generatePomFileForProductionPublication'.
     

-无法与Xml()一起应用于生成的POM   -无法获得类型配置容器的未知属性“实现”   org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer。

我尝试过类似的问题,但它们对我没有用。

0 个答案:

没有答案