简体   繁体   English

防止将额外的“app-unspecified.aar”上传到 Bintray

[英]Prevent uploading additional "app-unspecified.aar" to Bintray

I'm trying to create an android library and publish it to a Bintray repository.我正在尝试创建一个 android 库并将其发布到 Bintray 存储库。 But while running bintrayUpload Gradle task, there is an additional file called "app-unspecified.aar" which is uploaded to the Bintray along with the original artifact.但是在运行bintrayUpload Gradle 任务时,有一个名为“app-unspecified.aar”的附加文件与原始工件一起上传到 Bintray。

在此处输入图片说明

publish.gradle发布.gradle

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

publishing {
    publications {
        library(MavenPublication) {
            groupId publishGroupId
            artifactId publishArtifactId
            version android.defaultConfig.versionName

            pom {
                name = publishArtifactId
                description = libraryDescription
                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)
                        }
                    }
                }
            }
        }
    }
}

def _user = System.getenv("BINTRAY_USER")
def _key =  System.getenv("BINTRAY_API_KEY")

if(project.rootProject.file('local.properties').exists() && (_user == null || _user.isEmpty())){
    Properties properties = new Properties()
    properties.load(project.rootProject.file('local.properties').newDataInputStream())
    _user = properties.getProperty("bintray.user")
    _key = properties.getProperty("bintray.apikey");
}

bintray {
    user = _user
    key = _key
    override = true
    publications = ['library']
    configurations = ['archives']
    pkg {
        repo = bitrayRepo
        name = bintrayPackage
        desc = libraryDescription
        websiteUrl = siteUrl
        vcsUrl = gitUrl
        licenses = allLicenses
        publish = true
        publicDownloadNumbers = true
        version {
            name = android.defaultConfig.versionName
            released = new Date()
            vcsTag = android.defaultConfig.versionName
        }
    }
}

when I run gradle bintrayUpload I'm getting following in the output.当我运行gradle bintrayUpload时,我在输出中得到关注。

> Task :app:bintrayUpload
Uploading to https://api.bintray.com/content/chathurabuddi/android/datetime-picker-wheel/0.0.1/datetime-picker-wheel/app/unspecified/app-unspecified.aar...
Uploaded to 'https://api.bintray.com/content/chathurabuddi/android/datetime-picker-wheel/0.0.1/datetime-picker-wheel/app/unspecified/app-unspecified.aar'.
Uploading to https://api.bintray.com/content/chathurabuddi/android/datetime-picker-wheel/0.0.1/lk/chathurabuddi/datetime-picker-wheel/0.0.1/datetime-picker-wheel-0.0.1.aar...
Uploaded to 'https://api.bintray.com/content/chathurabuddi/android/datetime-picker-wheel/0.0.1/lk/chathurabuddi/datetime-picker-wheel/0.0.1/datetime-picker-wheel-0.0.1.aar'.
Uploading to https://api.bintray.com/content/chathurabuddi/android/datetime-picker-wheel/0.0.1/lk/chathurabuddi/datetime-picker-wheel/0.0.1/datetime-picker-wheel-0.0.1.pom...
Uploaded to 'https://api.bintray.com/content/chathurabuddi/android/datetime-picker-wheel/0.0.1/lk/chathurabuddi/datetime-picker-wheel/0.0.1/datetime-picker-wheel-0.0.1.pom'.

How can I prevent uploading that additional artifact to the Bintray?如何防止将额外的工件上传到 Bintray?

since you are declaring publications it's not necessary to add configurations = ['archives'] line.由于您要声明publications因此没有必要添加configurations = ['archives']行。 Try removing it from your publish.gradle file尝试从您的publish.gradle文件中删除它

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Bintray Gradle插件未上传工件 - Bintray gradle plugin not uploading artifacts .aar文件的其他文件 - additional files for .aar file 正在向查询添加其他未指定字段 - Additional, unspecified fields being added to a query 如何防止有人上传我的应用程序的 APK - How do I Prevent Someone Uploading APKs of My App Maven Eclipse 中的 Bintray 分发未上传 jar 文件。 错误代码401(未授权)但只针对jar包装? - Maven Bintray distribution in Eclipse is not uploading jar files. Error code 401 (Unauthorized) but only for jar packaging? Android 应用程序中的 bintray 库出现错误。 如果 Bintray 停止了他们的服务,我可以在我现有的项目中添加这个依赖项 - Getting error for bintray libraries in Android app. if Bintray stoped their service from where i can i add this dependency in my existing project 无法获取“https://fyber.bintray.com/maven/com/fyber/fairbid-sdk/3.0.1/fairbid-sdk-3.0.1.aar”。 从服务器收到状态代码 403:禁止 - Could not GET 'https://fyber.bintray.com/maven/com/fyber/fairbid-sdk/3.0.1/fairbid-sdk-3.0.1.aar'. Received status code 403 from server: Forbidden 如何防止对 OneToOne 关系的附加查询 - How to prevent additional query for OneToOne relation 如何将Android Gradle应用打包到* .jar或* .aar文件 - How to pack Android Gradle app to *.jar or *.aar file 每类 singleton,防止出现额外实例 - Per-Class singleton, prevent additional instances
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM