The heylogs Maven Enforcer rule checkChangelog integrates changelog validation directly into Maven's enforcer plugin, allowing you to enforce changelog quality standards as part of your build process. The build fails if the changelog doesn't meet the configured requirements.
Add the enforcer plugin with the heylogs custom rule to your pom.xml:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
<dependencies>
<dependency>
<groupId>com.github.nbbrd.heylogs</groupId>
<artifactId>heylogs-enforcer-rules</artifactId>
<version>_VERSION_</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>enforce-changelog</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<checkChangelog>
<versioning>semver</versioning>
</checkChangelog>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>List of changelog files to validate.
Type: List<File>
Default: ${project.basedir}/CHANGELOG.md
Example:
<inputFiles>
<inputFile>${project.basedir}/CHANGELOG.md</inputFile>
<inputFile>${project.basedir}/docs/HISTORY.md</inputFile>
</inputFiles>Search for changelog files recursively in directories.
Type: boolean
Default: false
Example:
<recursive>true</recursive>File to write validation results to.
Type: File
Default: stdout (console output)
Example:
<outputFile>${project.build.directory}/changelog-report.txt</outputFile>Versioning scheme to validate version numbers.
Type: String
Default: none
Values: semver, calver:PATTERN, regex:PATTERN
Example:
<versioning>semver</versioning>Tag naming strategy.
Type: String
Default: none
Example:
<tagging>prefix:v</tagging>Source code hosting platform.
Type: String
Default: none
Values: github, gitlab, forgejo
Example:
<forge>github</forge>Rule severity overrides (comma-separated).
Type: List<String>
Default: none
Example:
<rules>
<rule>no-empty-group:WARN</rule>
<rule>release-date:ERROR</rule>
</rules>Custom forge domain mappings.
Type: List<String>
Default: none
Example:
<domains>
<domain>gitlab.company.com:gitlab</domain>
<domain>github.enterprise.com:github</domain>
</domains>Output format for validation results.
Type: String
Default: stylish (human-readable)
Values: stylish, json
Example:
<format>json</format>Skip the enforcer rule execution.
Type: boolean
Default: false
Example:
<skip>true</skip>Or via command-line:
mvn clean install -Denforcer.skip=trueIgnore heylogs.properties configuration files.
Type: boolean
Default: false
Example:
<noConfig>true</noConfig>