4

我最近将我的 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'
}
  1. 我从 Sonatype 获得了我需要的 groupId
  2. 所以我修改了我的 gradle 脚本。

唯一相关的变化是:

publishedGroupId = 'com.github.danylo2006'

已改为

publishedGroupId = 'com.github.danylovolokh'

我运行相关命令: gradlew install gradlew bintrayUpload

我得到了 BUILD_SUCCESSFULL

但是,如果我向任何其他 gradle 项目添加新的依赖项,我会收到“错误:(36, 13) 无法解决:com.github.danylovolokh:hashtag-helper:1.1.0”的错误

4

3 回答 3

5

包含到 JCenter 是通过您的 groupId 的路径完成的。JFrog 还需要包含从您的包到 JCenter 的新路径。请通过 support@bintray.com 联系 JFrog 支持

于 2016-01-13T00:53:59.650 回答
3

@JBaruch 是正确的。似乎通过电子邮件发送 bintray 是真正改变这些事情的正确方法。但为了完整起见,我附上了我从 Bintray 收到的回复。希望发布他们的回复可以防止他们被电子邮件轰炸...

对于上下文,我有一个java包含包 ( groupID:artifact) 的存储库:

io.jeti.utils:serialize

当前有使用此 groupID 的版本 (1.0.0/1.0.1/1.0.2/1.0.3/1.0.4/)。我要求他们将其更改为

io.jeti:serialize

事实上,我已经使用这个缩短的 groupID 将版本(1.0.5/1.0.6)推送到 bintray。这是回应:

我们了解您的用例。在这种情况下,我们建议创建一个新包并提交新的包含请求。请让我解释一下,例如,让我们从您的 java 存储库中获取“序列化”包。目前,当只有一个与 Jcenter 同步时,它有 2 个路径前缀:io/jeti/utils/serialize/ -> 同步的 io/jeti/serialize -> jcenter 中不存在

重新链接新 groupId 将导致旧/当前 groupId (io/jeti/utils) 及其版本 (1.0.0/1.0.1/1.0.2/1.0.3/1.0.4/) 在以下情况下无法解析因为它依赖于旧的 groupId。这可能会破坏当前与您的构建和脚本的集成。因此,最好的方法是创建一个新包(例如serialize2),提交一个新的包含请求(其中包括新的groupId - io/jeti/serialize),我们将批准它并使其与JCenter 同步。在这种情况下,您将获得该软件包的所有现有版本(以及 1.0.5/1.0.6)的完整分辨率。

请让我们知道如何进行。

于 2017-09-28T13:31:52.550 回答
0

我痛苦地获得的建议是创建一个新的 bintray 包并要求将其发布到新的 groupId。我试图移动一个现有的包,并且 48 小时和 20 条消息往返于 JFrog 支持,这让我无法在旧位置或新位置发布我的原始包,也无法在新位置发布新包。

最后,我不得不注册一个新域名来托管我的项目,因为 bintray 有效地拒绝了对我试图更改的 groupId 的访问。

于 2019-02-08T09:21:01.820 回答