Development Setup
This setup is only intended for development purposes. If you are here to integrate the library into your project, follow the installation guide.
Prerequisite
Section titled “Prerequisite”Ensure the following tools are installed on your machine:
First, clone the repository:
cd toolbarThen, install dependencies and build the project locally:
mvn clean install -DskipTestsThe project is now ready for development.
CLI tools
Section titled “CLI tools”Unit Tests
Section titled “Unit Tests”You can run the unit test suite with:
mvn testRelease Process
Section titled “Release Process”Releases for this library are fully automated. Any changes pushed or merged into the main branch trigger a CI/DI
pipeline that handles versioning and publishing automatically.
How it works
Section titled “How it works”Once a commit is pushed to the main branch, the pipeline performs the following steps:
- Calculates the Version: It analyzes commit messages since the last release using Conventional Commits.
- Updates POM Files: It automatically updates the version in the root
pom.xmland all of its children modules. - Publishes the Release: it creates and pushes a new official GitHub release and tag using the updated version.
Note for Contributors: Because releases are automated, you do not need to run manual Maven release commands. Just ensure your commit messages follow the Conventional Commits specification (e.g.,
fix: ...,feat: ...) when merging intomain.
Versioning
Section titled “Versioning”The next version is applied dependent on the commit message. As stipulated by the Conventional Commits specification, version numbers are incremented as follows:
| Commit prefix | Version increment type | Original version | New version |
|---|---|---|---|
feat(scope)!: | Major | 1.0.0 | 2.0.0 |
fix(scope)!: | Major | 1.0.0 | 2.0.0 |
feat(scope): | Minor | 1.0.0 | 1.1.0 |
fix(scope): | Patch | 1.0.0 | 1.0.1 |
| Any other prefix | None | 1.0.0 | 1.0.0 |
Example
Section titled “Example”For example, a Maven project is currently at version 2.5.6 and is tagged. It then receives the following commits:
feat(#19)!: Added ISBN to books-> Version is now3.0.0fix(#20): Fixed issue where ...-> Version is now3.0.1feat(#15): Allow users to se...-> Version is now3.1.0Merge branch 'main' of https...-> Version is now3.1.0fix(#15): Prevent users from...-> Version is now3.1.1
The GitHub Action would increment the version to version 3.1.1 and then make the changes to the repository to reflect this. A tag (v3.1.1) is then pushed.
If a repository has no tags then all commits will be considered.
The GitHub Action and the aforementioned information and examples are sourced from this marketplace README page.