[Go] Use Gradle to publish Android Open source project to Jcenter

Source: Internet
Author: User
Tags maven central jcenter

 transferred from: http://blog.csdn.net/maosidiaoxian/article/details/43148643use Gradle to publish Android open source projects to JcenterCategory: Gradle notes 2015-01-26 09:41 8508 People read Comments ($) Collection report Gradle Release Jcenter Release Project

Directory (?) [+]

Like to do some open source project friends, I believe that many people want to be able to publish their own projects to the public central warehouse, such as the MAVEN central warehouse, for others to facilitate the integration of use. The students who use Android studio should also be impressed with Gradle and Jcenter, and many open source libraries are posted here. This article is mainly about how to use Gradle to publish to Jcenter.

This article is original.

Reprint please indicate CSDN blog Source:

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

Register first to https://bintray.com to register an account. Configure the account we need to configure the Bintray_user and Bintray_key two properties. Bintray_user is your registered account name, Bintray_key can be found in the following ways. , first click on your account name to enter the personal page. Then click Edit to go to the editing page. Then click on API Key, then click on the right side of show to see the API key.
Then go to your. Gradle directory (if you have not configured Gradle_user_home environment variables, it is in your user directory), edit gradle.properties (if not created), join the configuration:
[Plain]View Plaincopy
    1. Bintray_user=xxx
    2. Bintray_key=xxx


Configuration Items Download My project: https://github.com/msdx/gradle-publish, copy the gradle.properties into your project, and configure the properties. Then refer to the build.gradle here to add to your build.gradle: [Java]View Plaincopy
    1. Buildscript {
    2. repositories {
    3. Jcenter ()
    4. }
    5. dependencies {
    6. Classpath ' com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0 '
    7. }
    8. }

Add one more sentence: [Java]View Plaincopy
    1. Apply from: ' The relative path of your bintray.gradle '
Your bintray.gradle can refer to my project's bintray.gradle to write it. My bintray.gradle here is for the release of Android projects, the release of files including source code, documents and AAR, if you want to publish these, you can use directly. After the command is executed for release configuration, execution of Gradle Bintray is compiled, packaged, and published. Included in the Jcenter Central Library advanced into this page: Https://bintray.com/bintray/jcenter. Then click on the include My package, such as: then search for and tick your item in the popup dialog box. Then you can write your submission request (seemingly also can not write?) ), click "Send", then look at the administrator audit. Auditing waits for administrator approval. It's usually going to pass quickly.  If you're impatient, you can declare your warehouse as Maven {URL http://dl.bintray.com/your user name/maven} before you approve it. Additional instructions If you add this script and run the project in Android Studio, you will get an error, please comment on the "apply from" clause. The reason for the error is that it will not be able to find the task I packaged with AAR, but it is ok under the command line. If there is a better way to pack AAR, welcome to the exchange.

[Go] Use Gradle to publish Android Open source project to Jcenter

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.