java - Prevent uploading additional "app-unspecified.aar" to Bintray
问题描述
I'm trying to create an android library and publish it to a Bintray repository.
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.
publish.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.
> 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?
解决方案
since you are declaring publications
it's not necessary to add configurations = ['archives']
line. Try removing it from your publish.gradle
file
推荐阅读
- python - Python Turtle Collision 帮助和更新分数/生命
- git - 关闭第一个 PR,因为派生分支也有变化
- python - 如何在 python 环境中使用 Fonttools 的 pyftsubset,而不是从命令行
- java - 单击按钮更改图像
- python - 在numpy中正向和反向位扫描
- python-3.x - 是否可以在 Python 3x 中打印一个使用星号的空心盒子
- swift - 后台队列上的同步阻塞方法在主线程上执行
- sql - 如何计算开始日期和结束日期并以下一个开始日期开始每一行
- vba - Word 中的 VBA:CopyAsPicture 方法会忽略文本大小以及某些字体
- javascript - 为什么我的 JS 函数不能与我的按钮一起使用?