Use Gradle to publish an open-source Android project to JCenter and gradlejcenter

Source: Internet
Author: User
Tags maven central jcenter

Use Gradle to publish an open-source Android project to JCenter and gradlejcenter

I believe many people want to publish their projects to a public central repository, such as maven central repository, for easy integration and use by others. Those who use Android Studio should also be impressed with gradle and jcenter. Many open-source libraries are released here. This article mainly introduces how to use Gradle to publish to jcenter.

This article is original.

Reprinted, please indicate the source of the CSDN blog:

Http://blog.csdn.net/maosidiaoxian/article/details/43148643

Register an account first in https://bintray.com.
To configure an account, we need to configure two attributes: BINTRAY_USER and BINTRAY_KEY. BINTRAY_USER is the name of your registered account. You can find BINTRAY_KEY using the following methods ., Click your account name to go to the personal page.

Click Edit to go to the editing page.

Click the API key, and click Show on the right to view the api key.

Download my configuration Project: Development.
Then refer to the build. gradle here and add the following to your build. gradle:
buildscript {    repositories {        jcenter()    }    dependencies {    classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'    }}

Add the following sentence:
Apply from: 'relative path of your bintray. gradle'

The reason why http: // xxxx is not used here is that the file is first released for the android project, and then the project may be updated later.
You can refer to this document for your bintray. gradle. Here, bintray. gradle is used to publish android projects. The released files include the source code, documents, and AAR.
After you execute the command to complete the release configuration, execute gradle bintray to compile, package, and release it.
Review is pending for Administrator review. It is usually very quick to pass. If you are in a hurry, you can declare your repository by using maven {url http://dl.bintray.com/your user name /maven.
Note: if an error occurs when running the project in android studio after the script is added, please note the sentence "apply from. The error occurs because it cannot find the task where I packed the aar package, but it works in the command line. If you have a better way to package aar, please contact us.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.