Publish Android Library at Jitpack.io

Shivam Sharma
BeUni
Published in
3 min readMay 17, 2020

--

Photo by Lisa Fotios from Pexels

In this article, I am not going to show How to create a Library?

In this article, I am going to show How to publish the library? on Jitpack. To contribute Android Open Source Community.

While creating Android Apps we use sometimes Third-Party Library in our project. So I am always curious about how other Developers create a library and publish it on different places like Jcenter and Jitpack.

In Github, lots of libraries are open source so that developers can use it and save their time while developing apps.

I assumed you guys created Android Library in your system and uploaded code on Github.

Step 1:-

Add the following dependency in Root Project build.gradel file:-

dependencies {     
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' // Add this line
}

Step 2:-

Add the following line top of the build.gradel file in your Library section:-

apply plugin: 'com.github.dcendents.android-maven'     group='com.github.$YourUsername'

In group $YourUsername add your Github Username and click on Synq Now upload all your code to Github repo.

Step 3:-

Now you need to create Github Release from your Github repo from here,

click on release and create a release of repo

For more info click here How to create a Release version of your Github repo.

Here your 50% work is done. Now a few things left to live your first open-source library to another developer to use.

Step 4:-

Now Goto https://jitpack.io/ website.

Here this Git repo URL section add your Git Repo URL here and click on Look up button.

Git Repo Url Example like:-

https://github.com/yourUserName/repoName.git

After Click on Look Up Button below option comes:-

All your release version is shown here. After that click on Get it which version you want to publish.

Now Jitpack demonstrate how to implement a library in your project like below:-

In the Tag section put your release version in like ‘v0.1’ in my case.

That’s it.

Now as other developers you guys also contribute to Android Community with your Open Source project.

Hope this article helps.

--

--