I have created an Android
library for customer, which is stored in private repository (it can be Github or Bitbucket, does not matter). And now this library should be published to mavenCentral for future use by other programmers. And there are two important requirements:
How can I make this? I found many tutorials for mavenCentral, but all of them was only for public repos.
The process of publishing a Java library to Maven Central is not as straightforward as you might think and we will go through all the required steps to share your new shiny Java library with the of world. Maven central requires having a unique Group ID that is usually a domain name reversed.
So, if you feel up for a bit of a challenge, and want to do things the right way, here’s how you can get a library into MavenCentral, in 2021. Registering a Jira account with Sonatype, and verifying your ownership of the group ID you want to publish your artifact with
Once you account is verified you should be able to access the Nexus Repository Manager where you will be able to see the artifacts of your uploaded libraries. GPG is required by Maven Central in order to be able to publish a libraries. Install GPG. For MacOS users you can run: brew install gpg.
Finally, the fanciest place you can be in is The Central Repository via Sonatype OSSRH (OSS Repository Hosting), which I’ll refer to as simply MavenCentral from here on. This is the place to be if you’re a Maven dependency.
I am kind of facing some similar issue. However, I liked the idea in this link below:
https://medium.com/student-beans/publishing-a-library-as-a-aar-package-55ed725fa638
Create .aar file -> Create new repo -> Upload your .aar file to Github directly -> Create release version -> Distribute using Jitpack.
This way people can directly use your library without having to see the implementation.
Suggestion: If you want it to be more secure, I would recommend creating a separate account for AAR distribution. Make the AAR repo private and distribute Github token to your partner companies only. (This is just a suggestion and I have not yet tested it)
Update: Please follow the below tutorial as the above reference is not fully working.
https://www.talentica.com/blogs/publish-your-android-library-on-jitpack-for-better-reachability/
Take the jitpack.yml file from the first article and add it to your GitHub project along with the 3 generated files from the above tutorial.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With