Skip to content

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.

Ensure the following tools are installed on your machine:

First, clone the repository:

Terminal window
git clone [email protected]:Tofpu/toolbar.git
cd toolbar

Then, install dependencies and build the project locally:

Terminal window
mvn clean install -DskipTests

The project is now ready for development.

You can run the unit test suite with:

Terminal window
mvn test

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.

Once a commit is pushed to the main branch, the pipeline performs the following steps:

  1. Calculates the Version: It analyzes commit messages since the last release using Conventional Commits.
  2. Updates POM Files: It automatically updates the version in the root pom.xml and all of its children modules.
  3. 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 into main.

The next version is applied dependent on the commit message. As stipulated by the Conventional Commits specification, version numbers are incremented as follows:

Commit prefixVersion increment typeOriginal versionNew version
feat(scope)!:Major1.0.02.0.0
fix(scope)!:Major1.0.02.0.0
feat(scope):Minor1.0.01.1.0
fix(scope):Patch1.0.01.0.1
Any other prefixNone1.0.01.0.0

For example, a Maven project is currently at version 2.5.6 and is tagged. It then receives the following commits:

  1. feat(#19)!: Added ISBN to books -> Version is now 3.0.0
  2. fix(#20): Fixed issue where ... -> Version is now 3.0.1
  3. feat(#15): Allow users to se... -> Version is now 3.1.0
  4. Merge branch 'main' of https... -> Version is now 3.1.0
  5. fix(#15): Prevent users from... -> Version is now 3.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.