Objective
This two-day whim suddenly wanted to put the AAR of their Android library into the Jcenter, so that they can at any time and anywhere on the internet to get their own library reference, and now Android Studio has already defaulted on Jcenter's repositories as a source of dependency, and the previous mavencenter has begun to slowly discard it.
After half a day of hard work Gaocheng, but also encountered a lot of pits here to share the same ideas with you friends
(declares that this article is all about personal experience, and this article does not have to detail the details of all the steps, as far as possible to explain the important areas encountered, but also need the reader to practice, because this is the respect of the reader)
Apply for Bintray Account
To the Bintray website registration OSS account, use this site registration do not use the second, the second is enterprise-class;
Https://bintray.com/signup/oss
Https://bintray.com/signup
Because the Bintray official website constantly updated so the registration mechanism to increase the enterprise-level concept, so many before about Bintray upload Gradle build AAR posts are not up to the times ...
Before I myself follow Google's search results have been entered is the second URL, enterprise-level account must be set organization account, the results of two accounts to get around the people dizzy
Then prompt the following error:
http/1.1 401 Unauthorized [message:this resource requires authentication]
It turned out to be a miserable sum!
Then find the API key on your home page and create a repostiry type maven, maven-named repository for later use!
Writing Gradle Scripts
1, follow the guidance of Https://github.com/msdx/gradle-publish step by step, and then in your gradle tasks inside other find install and execute, The purpose of this step is to allow you to generate POM files based on the configuration inside the gradle.properties, which can be found under library/build/outputs
2, in the library gradle tasks found Publishing->bintrayupload to the AAR upload, upload success will get Gradle build successfully tips
3. Go to Bintray Home select Maven Repository then go in and click Add to Jcenter follow the prompts to write the annotations and submit, this will wait a certain time to review!
OK Gaocheng
Android uses Bintray to publish AAR to Jcenter