在上传gradle maven风味中缺少POM

时间:2015-10-27 15:42:24

标签: android maven-2 android-gradle pom.xml

我正在为Android设计一个aar库,我正面临着一个问题。 由于我介绍了flavor,不再上传POM文件。 AAR文件仍然正确上传但没有POM,则无法使用该库。

以下是build.gradle文件的一部分:

uploadArchives {
    repositories.mavenDeployer {

        snapshotRepository(url: nexus_mavenSnapshot) {
            authentication(userName: nexus_username
                    , password: nexus_password)
        }

        addFilter('legacyRelease') { artifact, file ->
            artifact.attributes.classifier.equals("legacyRelease")
        }
        addFilter('nbRelease') { artifact, file ->
            artifact.attributes.classifier.equals("nbRelease")
        }

        pom('nbRelease').artifactId = project.archivesBaseName + "-nb";
        pom('legacyRelease').artifactId = project.archivesBaseName + "-legacy";
    }
}

我发现的唯一一篇文章是: https://discuss.gradle.org/t/how-can-i-upload-multiple-flavors-artifacts-with-different-pom-files-using-mavendeployer/5887

他们的回答是手动上传我不想要的POM:)

有什么建议吗?

修改: 在试图恢复POM时,我删除了味道,但仍然没有POM。我需要删除的是,希望它会帮助某人:

publishNonDefault true

0 个答案:

没有答案