A Maven plugin for automated semantic versioning with markdown-based changelog management.
The Semantic Version Maven Plugin automates version management using semantic versioning principles (MAJOR.MINOR.PATCH). It integrates changelog management through markdown files, enabling you to:
- Create version bump specifications with markdown changelog entries
- Automatically update POM file versions based on semantic versioning rules
- Maintain synchronized changelog files across single and multi-module Maven projects
- Support multiple versioning strategies for different project structures
- Java: 17 or higher
- Maven: 3.9.12 or higher
Add the plugin to your pom.xml:
<build>
<plugins>
<plugin>
<groupId>io.github.bsels</groupId>
<artifactId>semantic-version-maven-plugin</artifactId>
<version>1.0.0</version>
</plugin>
</plugins>
</build>Full name: io.github.bsels:semantic-version-maven-plugin:create
Description: Creates a version markdown file that specifies which projects should receive which type of semantic version bump (PATCH, MINOR, or MAJOR). The goal provides an interactive interface to select projects and their version bump types, and allows you to write changelog entries either inline or via an external editor.
Phase: Not bound to any lifecycle phase (standalone goal)
| Property | Type | Default | Description |
|---|---|---|---|
versioning.modus |
Modus |
PROJECT_VERSION |
Versioning strategy: • PROJECT_VERSION: All projects in multi-module builds• REVISION_PROPERTY: Only current project using the revision property• PROJECT_VERSION_ONLY_LEAFS: Only leaf projects (no modules) |
versioning.directory |
Path |
.versioning |
Directory for storing version markdown files |
versioning.dryRun |
boolean |
false |
Preview changes without writing files |
versioning.backup |
boolean |
false |
Create backup of files before modification |
Basic usage (interactive mode):
mvn io.github.bsels:semantic-version-maven-plugin:createWith custom versioning directory:
mvn io.github.bsels:semantic-version-maven-plugin:create \
-Dversioning.directory=.versionsDry-run to preview:
mvn io.github.bsels:semantic-version-maven-plugin:create \
-Dversioning.dryRun=trueMulti-module project (leaf projects only):
mvn io.github.bsels:semantic-version-maven-plugin:create \
-Dversioning.modus=PROJECT_VERSION_ONLY_LEAFSFull name: io.github.bsels:semantic-version-maven-plugin:update
Description: Updates POM file versions and CHANGELOG.md files based on version markdown files created by the
create goal. The goal reads version bump specifications from markdown files, applies semantic versioning to project
versions, updates dependencies in multi-module projects, and merges changelog entries into CHANGELOG.md files.
Phase: Not bound to any lifecycle phase (standalone goal)
| Property | Type | Default | Description |
|---|---|---|---|
versioning.bump |
VersionBump |
FILE_BASED |
Version bump strategy: • FILE_BASED: Use version markdown files from .versioning directory• MAJOR: Apply MAJOR version bump to all projects• MINOR: Apply MINOR version bump to all projects• PATCH: Apply PATCH version bump to all projects |
versioning.modus |
Modus |
PROJECT_VERSION |
Versioning strategy: • PROJECT_VERSION: All projects in multi-module builds• REVISION_PROPERTY: Only current project using the revision property• PROJECT_VERSION_ONLY_LEAFS: Only leaf projects (no modules) |
versioning.directory |
Path |
.versioning |
Directory containing version markdown files |
versioning.dryRun |
boolean |
false |
Preview changes without writing files |
versioning.backup |
boolean |
false |
Create backup of POM and CHANGELOG files before modification |
Basic usage (file-based versioning):
mvn io.github.bsels:semantic-version-maven-plugin:updateForce MAJOR version bump (override version files):
mvn io.github.bsels:semantic-version-maven-plugin:update \
-Dversioning.bump=MAJORForce MINOR version bump:
mvn io.github.bsels:semantic-version-maven-plugin:update \
-Dversioning.bump=MINORForce PATCH version bump:
mvn io.github.bsels:semantic-version-maven-plugin:update \
-Dversioning.bump=PATCHDry-run to preview changes:
mvn io.github.bsels:semantic-version-maven-plugin:update \
-Dversioning.dryRun=trueWith backup files:
mvn io.github.bsels:semantic-version-maven-plugin:update \
-Dversioning.backup=trueCustom versioning directory:
mvn io.github.bsels:semantic-version-maven-plugin:update \
-Dversioning.directory=.versionsMulti-module project with revision property:
mvn io.github.bsels:semantic-version-maven-plugin:update \
-Dversioning.modus=REVISION_PROPERTYThese properties apply to both create and update goals:
| Property | Type | Default | Description |
|---|---|---|---|
versioning.modus |
Modus |
PROJECT_VERSION |
Defines versioning strategy for project structure: • PROJECT_VERSION: Process all projects in topological order• REVISION_PROPERTY: Process only the current project using the revision property• PROJECT_VERSION_ONLY_LEAFS: Process only leaf projects (no child modules) |
versioning.directory |
Path |
.versioning |
Directory path for version markdown files (absolute or relative to project root) |
versioning.dryRun |
boolean |
false |
When true, performs all operations without writing files (logs output instead) |
versioning.backup |
boolean |
false |
When true, creates .bak backup files before modifying POM and CHANGELOG files |
| Property | Type | Default | Description |
|---|---|---|---|
versioning.bump |
VersionBump |
FILE_BASED |
Determines version increment strategy: • FILE_BASED: Read version bumps from markdown files in .versioning directory• MAJOR: Force MAJOR version increment (X.0.0) for all projects• MINOR: Force MINOR version increment (0.X.0) for all projects• PATCH: Force PATCH version increment (0.0.X) for all projects |
-
Create version specification:
mvn io.github.bsels:semantic-version-maven-plugin:create
- Select MINOR version bump
- Enter changelog: "Added new user authentication feature"
-
Preview changes:
mvn io.github.bsels:semantic-version-maven-plugin:update -Dversioning.dryRun=true
-
Apply version update:
mvn io.github.bsels:semantic-version-maven-plugin:update
-
Create version specifications for multiple modules:
mvn io.github.bsels:semantic-version-maven-plugin:create
- Select
module-api→ MAJOR (breaking changes) - Select
module-core→ MINOR (new features) - Enter changelog for each module
- Select
-
Update with backups:
mvn io.github.bsels:semantic-version-maven-plugin:update -Dversioning.backup=true
Skip version file creation and force PATCH bump:
mvn io.github.bsels:semantic-version-maven-plugin:update -Dversioning.bump=PATCHConfigure the plugin directly in pom.xml:
<build>
<plugins>
<plugin>
<groupId>io.github.bsels</groupId>
<artifactId>semantic-version-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<modus>PROJECT_VERSION</modus>
<versionDirectory>.versioning</versionDirectory>
<dryRun>false</dryRun>
<backupFiles>true</backupFiles>
<versionBump>FILE_BASED</versionBump>
</configuration>
</plugin>
</plugins>
</build>This project is licensed under the MIT License. See the LICENSE file for details.