【问题标题】:Two paths under the same package in bintraybintray同一个包下的两条路径
【发布时间】:2018-02-27 22:01:07
【问题描述】:
我已成功将一个库上传到 bintray,它正确显示了版本和依赖项。但是当我请求将它链接到 jcenter 时,我得到了这样的回复:
你好,
我们可以看到同一个包下有两个路径,一个用于.aar/.jar/.apk和jar-sources.jar和*-javadoc.jar下的文件:
/com/androiddev/android-dev-core/1.0.0
还有一个用于 .pom 文件:
/com/androiddev/core/1.0.0
我们只能为单个包裹批准一条路径。
请合并这两条路径,并让我们知道您想要包含哪个路径前缀。
谢谢,
JFrog 支持
我可以在 bintray 的文件部分下看到两个路径。知道如何解决这个问题吗?
【问题讨论】:
标签:
android
maven
android-library
bintray
jcenter
【解决方案1】:
为避免此问题,请确保您的库名称与您在 bintray 上创建的库名称相似。如果它们不同,当您使用 bintrayUpload 命令从 android studio 终端将库上传到 bintray 时,它将创建两个单独的路径。
我在 build.gradle 中的 bintray 配置如下。
ext {
bintrayRepo = 'dev' //the maven repo name (created on bintray)
bintrayName = 'android-dev-core' //the name you want to give at your project on bintray
orgName = 'thisisjatinrana' //your user name
publishedGroupId = 'com.jatin' //aaaa : the librairy group
artifact = 'android-dev-core' //BBBB : the library name
libraryVersion = "1.0.0" //the librairy version
//the library will be : aaaa:BBBB:version
libraryName = 'android-dev-core'
libraryDescription = 'Android essential building blocks to speed up development process'
siteUrl = 'https://github.com/thisisjatinrana/AndroidDevCore'
gitUrl = 'https://github.com/thisisjatinrana/AndroidDevCore.git'
developerId = 'jatinrana'
developerName = 'Jatin Rana'
developerEmail = 'thisisjatinrana@gmail.com'
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
这里的artifact和bintray项目名应该和你在android studio中的库名一样。
【解决方案2】:
如果你的 lib 和 artifact 有不同的名字,你会看到 bintray 的文件部分有两个文件夹。 Pom 文件和 jar 文件将位于不同的文件夹中。为避免这种情况,您应该将您的工件和您的 lib(module) 重命名为相同。
我认为 bintray 项目名称可以不同。它是可选的。工件和模块名称相等就足够了。构建项目后,您将在同一文件夹中看到您的 pom 文件和 jar 文件。