GuntherRademacher / rr

RR - Railroad Diagram Generator
Apache License 2.0
467 stars 51 forks source link

Replace defunct JCenter with Maven Central #22

Closed bannmann closed 1 year ago

bannmann commented 1 year ago

Following up on #12 and #14, this PR should complete the work of publishing RR as a reusable library.

As JCenter was turned into a read-only archive in 2021, RR needs a new distribution repository. Using Maven Central has the added benefit that developers will not have to configure anything to consume the artifact, but just add a dependency to their project. The standard way to do this is to use Sonatype OSSRH (OSS Repository Hosting).

With this PR, the build should set all fields required by the OSSRH guidelines. The approach taken is based on this article.

Before merging this, do the following:

  1. Set up an OSSRH account and repository following the official guide.
  2. OSSRH may tell you to use a different server. If that's the case you need to adapt releaseRepo and snapshotRepo in the Gradle file accordingly.
  3. Put your credentials for GPG (signing.keyId, signing.password and signing.secretKeyRingFile) and OSSRH (ossrhUsername and ossrhPassword) into ~/.gradle/gradle.properties.
  4. Perform a publish with a snapshot version. Log in to OSSRH to verify the artifacts were uploaded.
    • Note: while snapshots can be consumed by developers (via the special OSSRH snapshots repository), unlike releases they do not get pushed to Maven Central.

After merging this, you should be able to publish a master build (non-snapshot versions) to OSSRH's Nexus. There, you can log in, find the staging repository for your build and trigger the release process which includes automated requirements validation. If successful, the build will be propagated to Maven Central in a matter of hours.

Let me know if you need any assistance with this.

GuntherRademacher commented 1 year ago

Great stuff. Thank you very much for your guidance, it worked exactly as you described it. The only thing that I had to add was signing the webapp.