android – 如果项目已经上传到bintray并与jcenter同步,如何更改groupid?
作者:互联网
我最近将我的github项目上传到bintray并成功将其与JCenter存储库同步.
我用过这个教程:
http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en
所以我的gradle依赖是:
dependencies {
compile 'com.github.danylo2006:hashtag-helper:1.1.0'
}
为了上传它,我修改了我的build.gradle并添加了相关的脚本安静.教程中的所有内容.
... some code here
ext {
bintrayRepo = 'maven'
bintrayName = 'hashtag-helper'
publishedGroupId = 'com.github.danylo2006'
libraryName = 'HashTagHelper'
artifact = 'hashtag-helper'
libraryDescription = 'This is a library designed for highlighting hashtags ("#example") and catching click on them.'
siteUrl = 'https://github.com/danylo2006/HashTagHelper'
gitUrl = 'https://github.com/danylo2006/HashTagHelper.git'
libraryVersion = '1.1.0'
developerId = 'danylovolokh'
developerName = 'Danylo Volokh'
developerEmail = 'v.danylo@gmail.com'
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
这是棘手的部分:
我已经将我的github昵称danylo2006改为danylovolokh,现在我想改变gradle依赖:
dependencies {
compile 'com.github.danylo2006:hashtag-helper:1.1.0'
}
改成:
dependencies {
compile 'com.github.danylovolokh:hashtag-helper:1.1.0'
}
>我从Sonatype获得了我需要的groupId
>所以我修改了我的gradle脚本.
唯一相关的变化是:
publishedGroupId = 'com.github.danylo2006'
已改为
publishedGroupId = 'com.github.danylovolokh'
我运行相关命令:
gradlew安装
gradlew bintrayUpload
我得到了BUILD_SUCCESSFULL
但是如果我向任何其他gradle项目添加新依赖项,我会收到错误“错误:(36,13)无法解决:com.github.danylovolokh:hashtag-helper:1.1.0”
解决方法:
包含在JCenter中的是groupId的路径. JFrog还需要包含从包到JCenter的新路径.
请通过support@bintray.com联系JFrog支持
标签:android,maven,jcenter,sonatype,bintray 来源: https://codeday.me/bug/20190611/1220725.html