Template to easily create a Java Maven library and publish it automatically on GitHub Package and Maven Central, the publication is automated via the repo versions.
To use this template, you just need to click on "Use this template" at the top of the main page of this repository, or you can copy/paste this repository.
- Create an account on Sonatype
- Create a JIRA ticket on Sonatype to approve your groupId (io.github.YOUR-GITHUB-USERNAME)
- Generate a gpg key and distribute the public key to a keyserver
- Fix pom.xml
- To guide you, a FIXME tag has been added to all lines to be edited.
- Config SonarCloud
- To configure SonarCloud for your project you must go to https://sonarcloud.io
- Replace the file at /.github/workflows/sonar.yml with your own yaml file at https://sonarcloud.io and if your Java project is not on Java 11 edit that yaml file.
- Create your GitHub secrets on your repository
- NEXUS_USERNAME with your username used on Sonatype
- NEXUS_PASSWORD with your password used on Sonatype
- GPG_PRIVATE_KEY with the private key of your generated pgp key
- to get the private key
gpg --armor --export-secret-key <key-id> > privkey.asc
- to get the private key
- GPG_PASSPHRASE with the passphrase of your gpg key
- Activate the JavaDoc GitHub page
- To enable the JavaDoc GitHub Page, you need to enable the GitHub page in your repository settings for the javadoc branch.
Don't forget to add your own SonarCloud badges to your readme 😉
- to get your maven-central badge : https://shields.io/category/platform-support
- to get your JavaDoc Badge :
[![Javadoc](https://img.shields.io/badge/JavaDoc-Online-green)](https://<github-username>.github.io/<github-repo>/javadoc/)
On the link of JavaDoc badge, replace <github-username>
by your GitHub username, <github-repo>
by the name of your GitHub repository.
If you have any problems setting up CI, CD or other, do not hesitate to contact me at Mathieu.Soysal@etu.umontpellier.fr