How to change groupid if project is already uploaded to bintray and synced with jcenter?
Asked Answered
D

3

5

I've recently uploaded my github project to bintray and successfully synced it with JCenter repository. I used this tutorial:

http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-maven-central-as-dependency/en

So my gradle dependency was :

dependencies {
     compile 'com.github.danylo2006:hashtag-helper:1.1.0'
}

In order to upload it I've modified my build.gradle and added relevant peace of script. Everything like in the tutorial.

... 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 = '[email protected]'

    licenseName = 'The Apache Software License, Version 2.0'
    licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
    allLicenses = ["Apache-2.0"]
}

Here is the tricky part:

I've changed my github nickname danylo2006 to danylovolokh and now I want to change gradle dependency:

dependencies {
     compile 'com.github.danylo2006:hashtag-helper:1.1.0'
}

Change to:

dependencies {
     compile 'com.github.danylovolokh:hashtag-helper:1.1.0'
}
  1. I got groupId that I need from Sonatype
  2. So I've modified my gradle script.

The only relevant change is :

publishedGroupId = 'com.github.danylo2006'

Has been changed to

publishedGroupId = 'com.github.danylovolokh'

I run the relative commands: gradlew install gradlew bintrayUpload

And I got BUILD_SUCCESSFULL

But if I add new dependency to any other gradle project I get an error that "Error:(36, 13) Failed to resolve: com.github.danylovolokh:hashtag-helper:1.1.0"

Didi answered 13/1, 2016 at 0:11 Comment(0)
S
5

Inclusion to JCenter is done by the path of your groupId. JFrog needs to include the new path from your package to JCenter as well. Please contact JFrog support at [email protected]

Soraya answered 13/1, 2016 at 0:53 Comment(1)
Helped. I've asked them to re-link my package to the new path. And they did it within a day. ThanksDidi
H
3

@JBaruch is correct. It seems that emailing bintray is the correct way to really get these things changed. But for completeness, I am attaching the response I received from Bintray. Hopefully posting their response will prevent them from getting bombarded by emails...

For context, I have a java repository with the package (groupID:artifact):

io.jeti.utils:serialize

There are currently versions (1.0.0/1.0.1/1.0.2/1.0.3/1.0.4/) using this groupID. I asked them to change this to

io.jeti:serialize

And in fact, I already pushed versions (1.0.5/1.0.6) to bintray with this shortened groupID. This was the response:

We understand your use case. In such cases, we recommend creating a new package and submit a new inclusion request. Please let me explain, let's take 'serialize' package from your java repo for example. Currently it has 2 path prefixes when only one is synced with Jcenter: io/jeti/utils/serialize/ -> Synced io/jeti/serialize -> doesn't exist in jcenter

Relinking the new groupId, will cause the old/current groupId (io/jeti/utils) and its versions (1.0.0/1.0.1/1.0.2/1.0.3/1.0.4/) to be un-resolvable when since it rely on the old groupId. This might broke current integrations with your builds and scripts. Therefore, the best approach is to create a new package (e.g serialize2), submit a new inclusion request (which includes the new groupId - io/jeti/serialize) and we will approve it and make it synced with JCenter. In this case, you will get a full resolution of all of your existing versions of the package (as well as 1.0.5/1.0.6).

Please let us know how to proceed.

Hootman answered 28/9, 2017 at 13:31 Comment(0)
L
0

My painfully acquired advice would be to create a new bintray package and ask for that to be published to the new groupId. I have tried to move an existing package and 48 hours and 20 messages to and from JFrog support have left me unable to publish my original package at the old or new location, nor a new package at the new location.

In the end I have had to register a new domain name to host my project, as bintray have effectively denied access to the groupId I was trying to change to.

Lidstone answered 8/2, 2019 at 9:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.