This is a Maven parent POM (io.github.rdlopes:maven-root-pom) designed to provide standardized configuration for Java projects in the io.github.rdlopes ecosystem.
It includes comprehensive dependency management, plugin configurations, and build standards to ensure consistency across all projects.
The POM serves as an "Uber POM" that centralizes:
-
Dependency Management: BOMs for major frameworks (Spring Boot, JUnit, Mockito, etc.)
-
Plugin Configuration: Standardized build, test, and quality plugins
-
Build Standards: Java 21+, Maven 3.9.6+, UTF-8 encoding
-
CI/CD Integration: GitHub Actions workflows for continuous integration and deployment
-
Code Quality: Spotless formatting, JaCoCo coverage, Maven Enforcer rules
-
Java: 21+ (enforced by Maven Enforcer Plugin)
-
Maven: 3.9.6+ (enforced by Maven Enforcer Plugin)
The project uses Maven wrapper with specific JVM configurations:
# UTF-8 encoding and Java module compatibility
-Dfile.encoding=UTF-8
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.text=ALL-UNNAMED
--add-opens=java.desktop/java.awt.font=ALL-UNNAMEDTo use this parent POM in your project, add it to your pom.xml:
<parent>
<groupId>io.github.rdlopes</groupId>
<artifactId>maven-root-pom</artifactId>
<version>[VERSION]</version>
</parent>The parent POM provides managed versions for:
-
Spring Boot: 3.5.3 (BOM imported)
-
Jackson: 2.19.1 (BOM imported)
-
SpringDoc OpenAPI: 2.8.9
-
JUnit: 5.13.3 (BOM imported)
-
Mockito: 5.17.0 (BOM imported, test scope)
-
AssertJ: 3.27.3 (BOM imported)
-
Cucumber: 7.26.0 (BOM imported)
-
Playwright: 1.53.0 (for browser testing)
# Standard build and test
./mvnw install
# Code formatting
./mvnw spotless:apply
# Format check (fails build if not formatted)
./mvnw spotless:check
# Generate living documentation (if using Cucumber)
./mvnw post-integration-testThe project uses Maven wrapper with:
-
Batch mode:
-Bflag for non-interactive execution -
UTF-8 encoding: Configured in
.mvn/jvm.config -
Java module compatibility: Opens required modules for modern Java
-
POM formatting: Uses
sortPomwithexpandEmptyElements=false -
Execution phases: Format on
compile, check onverify
The following rules are enforced during build:
-
Dependency Convergence: Ensures consistent dependency versions
-
Java Version: Minimum Java 21
-
Maven Version: Minimum 3.9.10
-
Plugin Versions: Bans LATEST, RELEASE, and SNAPSHOT versions
-
Surefire/Failsafe Alignment: Ensures same versions for test plugins
Trigger: Push to main branch
Environment: * Ubuntu Latest * Java 21 (Temurin distribution) * Maven cache enabled
Build: ./mvnw install
Trigger: Manual workflow dispatch
Target: Maven Central via OSSRH
Requirements:
* GPG signing (OSSRH_GPG_PRIVATE_KEY secret) * OSSRH credentials (OSSRH_USERNAME, OSSRH_PASSWORD) * GitHub token for release operations
Release Commands:
# With specific version
./mvnw release:prepare release:perform -DreleaseVersion=$VERSION
# Auto version increment
./mvnw release:prepare release:perform-
Central Publishing: Auto-publish to Maven Central
-
GPG Plugin: Artifact signing with pinentry-mode loopback
-
Javadoc Plugin: Generate documentation JARs
-
Source Plugin: Generate source JARs
-
Spotless: Code formatting
-
JaCoCo: Code coverage reporting
-
Maven Enforcer: Build consistency rules
-
Cukedoctor: Living documentation from Cucumber features
-
Versions Plugin: Dependency version management
-
Ensure all tests pass and code is formatted
-
Use GitHub Actions CD workflow for releases
-
GPG signing is mandatory for Maven Central deployment
-
Releases create Git tags automatically
-
Spotless formatting is enforced in CI
-
Run
./mvnw spotless:applybefore committing -
Format check runs during
verifyphase
If build fails with module access errors, verify JVM config flags in .mvn/jvm.config
Require explicit version management in your project’s dependencyManagement section
This project is licensed under the MIT License - see the LICENSE for details.