Android 如何从Maven uploadArchives禁用默认存档?

Android 如何从Maven uploadArchives禁用默认存档?,android,maven-2,android-gradle-plugin,Android,Maven 2,Android Gradle Plugin,我使用下一个gradle脚本将apk推送到自定义nexus: configurations { apks } def apk = null android.applicationVariants.all { variant -> if ( (variant.name).equals("debug") ) { variant.outputs.each { output -> apk = output.outputFile

我使用下一个gradle脚本将apk推送到自定义nexus:

configurations {
    apks
}

def apk = null
android.applicationVariants.all { variant ->
    if ( (variant.name).equals("debug") ) {
        variant.outputs.each { output ->
            apk = output.outputFile
        }
    }
}


def isReleaseBuild() {
    return VERSION_NAME.contains("SNAPSHOT") == false
}

def getReleaseRepositoryUrl() {
    return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
            : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}

def getSnapshotRepositoryUrl() {
    return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
            : "https://oss.sonatype.org/content/repositories/snapshots/"
}

def getRepositoryUsername() {
    return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
}

def getRepositoryPassword() {
    return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
}

afterEvaluate { project ->
    uploadArchives {
        repositories {
            mavenDeployer {
                //beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

                pom.groupId = GROUP
                pom.artifactId = POM_ARTIFACT_ID
                pom.version = VERSION_NAME

                repository(url: getReleaseRepositoryUrl()) {
                    authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
                }
                snapshotRepository(url: getSnapshotRepositoryUrl()) {
                    authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
                }

                pom.project {
                    name POM_NAME
                    packaging POM_PACKAGING
                    description POM_DESCRIPTION
                    url POM_URL

                    scm {
                        url POM_SCM_URL
                        connection POM_SCM_CONNECTION
                        developerConnection POM_SCM_DEV_CONNECTION
                    }

                    licenses {
                        license {
                            name POM_LICENCE_NAME
                            url POM_LICENCE_URL
                            distribution POM_LICENCE_DIST
                        }
                    }

                    developers {
                        developer {
                            id POM_DEVELOPER_ID
                            name POM_DEVELOPER_NAME
                        }
                    }
                }
            }
        }
    }


    artifacts {
        apks new DefaultPublishArtifact("My Project", "apk", "apk", "final-apk", new Date(), apk)
    }

}
问题在于maven插件推送2个apk文件: 1一些没有分类器的默认值 2我自己和我的分类器

默认apk不是signet,我无法将其安装到设备

我还需要为我自己的正确apk使用分类器


如何禁用推送默认apk?

与Maven的关系在哪里?因为这是一个gradle文件?@khmarbaise这是使用gradle插件“Maven”将apk推送到nexus