A reusable parent pom for maven projects.
This project uses GitHub Actions for continuous integration and deployment:
The PR Test workflow runs automatically when a pull request is created or updated against the main branch. It ensures that all tests pass before the PR can be merged.
The Publish to Nexus workflow runs automatically when code is pushed to the main branch (which happens when a PR is merged). It builds the project, runs the tests, and if all tests pass, it publishes the JAR to a private Nexus Repository Manager.
To use the Publish to Nexus workflow, you need to set up the following secrets in your GitHub repository:
NEXUS_USERNAME
: Username for Nexus authenticationNEXUS_PASSWORD
: Password for Nexus authenticationThe Nexus repository URLs are configured in the pom.xml
file. Update these URLs to point to your actual Nexus repositories:
<distributionManagement>
<repository>
<id>nexus-repository</id>
<name>Nexus Release Repository</name>
<url>https://nexus.example.com/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus-repository</id>
<name>Nexus Snapshot Repository</name>
<url>https://nexus.example.com/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
The Publish Site to GitHub Pages workflow runs automatically when code is pushed to the main branch. It builds the Maven site and publishes it to GitHub Pages, making the documentation accessible via a web browser.
To use this workflow, you need to:
https://<username>.github.io/<repository>/
after the workflow runs successfullyThe workflow uses GitHub’s official actions for Pages deployment and doesn’t require any additional secrets.
This project is configured to publish to Maven Central via the Sonatype OSSRH (OSS Repository Hosting) service.
Sonatype OSSRH Account: You need to have an account on Sonatype JIRA and create a ticket to request a new project namespace. Follow the OSSRH Guide for details.
GPG Key: You need a GPG key to sign the artifacts. Create one using:
gpg --gen-key
Export your GPG key in ASCII armor format:
gpg --armor --export-secret-keys YOUR_KEY_ID > private-key.asc
To use the Publish to Maven Central workflow, set up the following secrets in your GitHub repository:
OSSRH_USERNAME
: Username for Sonatype OSSRHOSSRH_PASSWORD
: Password for Sonatype OSSRHGPG_PRIVATE_KEY
: Your GPG private key in ASCII armor format (the content of private-key.asc)GPG_PASSPHRASE
: Passphrase for your GPG keySnapshots are automatically deployed when code is pushed to the main branch.
To create a release:
The workflow will:
Dan Rollo