Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribute the library via JCenter #2

Open
jbaruch opened this issue Oct 12, 2014 · 20 comments
Open

Distribute the library via JCenter #2

jbaruch opened this issue Oct 12, 2014 · 20 comments
Assignees

Comments

@jbaruch
Copy link

jbaruch commented Oct 12, 2014

Gradle features great dependency management that is intended to work with remote repositories.
Distributing your library via JCenter will make the consumption of your library much easier and will increase the adoption.

Currently developers don't know how to consume your library (see example).

Publishing to JCenter is very simple and can be fully automated using the Gradle Bintray plugin.

@faradaj faradaj self-assigned this Oct 13, 2014
@Odaym
Copy link

Odaym commented Apr 14, 2015

100%

I've chosen to go with another library simply because you distribute it in an awkward way. Good effort anyways though :)

@jbaruch
Copy link
Author

jbaruch commented Apr 14, 2015

What do you mean by "distribute it in an awkward way"?

@Odaym
Copy link

Odaym commented Apr 14, 2015

meaning I cannot simply place compile 'com.faradaj:blur-behind:[LATEST_RELEASE_VERSION]' in my gradle and run

@jbaruch
Copy link
Author

jbaruch commented Apr 14, 2015

Not sure what this code is. Using the dependency? Deploying it?

@Odaym
Copy link

Odaym commented Apr 14, 2015

Using the dependency, the developer hosts it on mavenCentral for example and you just place that line in your build.gradle and the library is ready to use when you Sync Gradle again, as you know.

Here it requires downloading the project and running gradle install on it and then mentioning it as under mavenLocal()

@jbaruch
Copy link
Author

jbaruch commented Apr 14, 2015

hm, I am not sure I follow. Using any dependency from Jcenter takes the following code in gradle:

repositorties {
    jcenter()
}
dependencies {
    compile 'com.faradaj:blur-behind:[LATEST_RELEASE_VERSION]'
}

When you use Android Studio the first three lines are already generated for you, so all you need to do is paste the compile line.

@Odaym
Copy link

Odaym commented Apr 14, 2015

ahhh so he DID do what you suggested in this issue! I thought that you suggested it and it was forgotten so my above comments are in support to your suggestion. Sorry for the confusion!

@jbaruch
Copy link
Author

jbaruch commented Apr 14, 2015

who did what? :)
Now I am confused :)

@Odaym
Copy link

Odaym commented Apr 14, 2015

The author of this lib, he did what you suggested by distributing it through JCenter. I thought that he just ignored that. So I was saying 100% that you are right he should do that. Seems he did it but didnt update the "Usage" part in the lib's main page. And the issue isnt closed :)

@jbaruch
Copy link
Author

jbaruch commented Apr 14, 2015

OK, now I got it :) I was sure you're one of the authors and referring to JCenter when you mentioned "another library" :)

I have no idea whether he did it or not, but yes, the issue is still open.

@Odaym
Copy link

Odaym commented Apr 15, 2015

So what I did was get gradle-1.10 (required for building this) and I ran it on the blur-behind folder (the folder was in my Downloads/ folder) and then went to my build.gradle and placed those lines for mavenLocal() under repositories and compile 'com.faradaj:blur-behind:1.0.3' under dependencies but I still get error failed to resolve: com.faradaj:blur-behind:1.0.3

Do you think maybe that the version is no longer 1.0.3? cause the last commit mentioned 1.0.3 and your Stackoverflow answer also mentioned 1.0.3 as the latest version. Any ideas? I appreciate that you are helping me here when you don't really have to!

@Odaym
Copy link

Odaym commented Apr 15, 2015

I just copied Blur.java and BlurBehind.java to my project and now it works fine

@faradaj
Copy link
Owner

faradaj commented May 14, 2015

Uploaded library's last release to JCenter, waiting for distribution.

@jbaruch
Copy link
Author

jbaruch commented May 14, 2015

👍

@KenVanHoeylandt
Copy link

@ faradaj: You could create your own free repository on Bintray. That way you don't have to wait for JCenter release.
The only difference is that developers have to specify your repository in their gradle file, like this:

repositories {
    mavenCentral()
    maven {
        url "https://dl.bintray.com/elastique/poetry"
    }
}

@jbaruch
Copy link
Author

jbaruch commented Jun 18, 2015

Not sure what you mean by "waiting for release". Once your package is included in JCenter, whatever you publish in your repository becomes immediately available in JCenter.

@KenVanHoeylandt
Copy link

I was referring to Faradaj's comment: "waiting for distribution"
There is an approval process for JCenter:

The request message is sent to the Bintray team, who assign your package a path in the relevant part of the tree structure of the JCenter repository.

If the request is approved, an indication that the package is included in JCenter is displayed in the Package page, in the Included in work area in the bottom right corner of the page."

Source: https://bintray.com/docs/usermanual/uploads/uploads_includingyourpackagesinjcenter.html

By publishing it in your own (bintray) repository, you don't need to wait for approval.

@jbaruch
Copy link
Author

jbaruch commented Jul 8, 2015

This is done only once, per package. Once the package is approved, when you publish the files in your repository they appear in jcenter as well right away.

@RobinJ1995
Copy link

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.faradaj:blur-behind:1.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/faradaj/blur-behind/1.1/blur-behind-1.1.pom
         https://jcenter.bintray.com/com/faradaj/blur-behind/1.1/blur-behind-1.1.jar
         https://repo1.maven.org/maven2/com/faradaj/blur-behind/1.1/blur-behind-1.1.pom
         https://repo1.maven.org/maven2/com/faradaj/blur-behind/1.1/blur-behind-1.1.jar
         file:/home/robin/.m2/repository/com/faradaj/blur-behind/1.1/blur-behind-1.1.pom
         file:/home/robin/.m2/repository/com/faradaj/blur-behind/1.1/blur-behind-1.1.jar
         https://repo.commonsware.com.s3.amazonaws.com/com/faradaj/blur-behind/1.1/blur-behind-1.1.pom
         https://repo.commonsware.com.s3.amazonaws.com/com/faradaj/blur-behind/1.1/blur-behind-1.1.jar
         https://jitpack.io/com/faradaj/blur-behind/1.1/blur-behind-1.1.pom
         https://jitpack.io/com/faradaj/blur-behind/1.1/blur-behind-1.1.jar
         file:/opt/android-sdk/extras/android/m2repository/com/faradaj/blur-behind/1.1/blur-behind-1.1.pom
         file:/opt/android-sdk/extras/android/m2repository/com/faradaj/blur-behind/1.1/blur-behind-1.1.jar
         file:/opt/android-sdk/extras/google/m2repository/com/faradaj/blur-behind/1.1/blur-behind-1.1.pom
         file:/opt/android-sdk/extras/google/m2repository/com/faradaj/blur-behind/1.1/blur-behind-1.1.jar

So which repository do I actually need to add?

@Son-kun
Copy link

Son-kun commented Jan 4, 2016

It's any chance for appearance of this tool on any repository?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants