pervasive-systems / eSense-Android-Library

A light-weight android library to build mobile apps with eSense
http://www.esense.io/
Apache License 2.0
10 stars 6 forks source link

Deploy lib to Maven Central Repository #2

Open alessandro-montanari opened 5 years ago

freundTech commented 3 years ago

I forked this repository to https://github.com/freundTech/eSense-Android-Library and added CI and made it available in JitPack and GitHub Packages. I already submitted all my non-CI related changes as pull requests.

Would there be interest in me submitting CI configurations to help with getting this library to maven central?

alessandro-montanari commented 3 years ago

Thanks for your pull requests, I have just merged them. Yes, it would be great if you could help with maven central.

freundTech commented 3 years ago

The first step would be deciding which repository to publish to. There is the traditional Maven Central Repository hosted by sonatype (https://central.sonatype.org/) and the newer, more modern JCenter by JFrog.

Android Studio defaults to using JCenter since 2014. Both repositories are free for open source projects.

JCenter, in addition to hosting their own packages also mirrors all packages from Maven Central and, due to being more modern, is easier to submit to. They also offers a feature where they can publish packages you publish with them on Maven Central for you.

My suggestion would be publishing on JCenter and optionally having it forward the package to Maven Central (Of course you could also publish to Maven Central and have JCenter automatically mirror it).

Publishing to JCenter requires creating an OSS Bintray account (https://bintray.com/signup/oss) and publishing the package to a public bintray repository. Form there it can then be promoted to JCenter.

Publishing to Maven Central requires creating an account on the sonatype jira and opening a ticket requesting access to OSSRH (https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=21&pid=10134). Then packages can be published to OSSRH and from there be promoted to Maven Central.

The publishing to either bintray or OSSRH needs some changes to the build.gradle file and can then either be done on a local machine by a developer with the needed credentials or could be automated using Github actions or an other CI/CD runner.