Maven POM Conventions
1. Overview
Every EMS Spring Boot service (admin-service, registration-portal, and future admin-portal) inherits from the same parent POM and exposes the same set of Maven profiles. Build variants (dev vs prod, with or without OTel, with or without OpenAPI docs, with or without TLS) are selected by profile activation — not by separate build configurations or modules.
This convention is inherited from JHipster. We keep it because it is mature, widely understood, documented by the generator, and has no concrete better alternative in our stack. If we ever find one, it’ll be a project-wide rethink; for now, follow the pattern.
This page documents what profiles exist, what each enables, and what a new service’s POM should look like.
See also: Jib Docker Build, Helm Chart Structure.
2. Parent POM
Coordinates: za.co.idealogic:event:1.3.x. Lives at [parent-pom/](../../../parent-pom/) in the workspace; GitHub repo named event.
The parent pins:
-
Spring Boot (currently 3.2.x baseline, tracked via JHipster 8.11’s BOM)
-
JHipster framework version (8.11.0)
-
Common plugin versions (Jib, liquibase, modernizer, checkstyle, git-commit-id, helm-maven-plugin)
-
Shared dependency management (Jackson, Mapstruct, Hazelcast, SpringDoc, dayjs stand-ins for the Java side)
Child POMs inherit via <parent>:
<parent>
<groupId>za.co.idealogic</groupId>
<artifactId>event</artifactId>
<version>1.3.1</version>
<relativePath/> <!-- resolve from ~/.m2, not local relative path -->
</parent>
Bumping the parent is a workspace-level event — upgrade all consumers together.
3. Profile Inventory
Active profiles combine via comma: mvn -Pprod,api-docs,otlp package. Multiple simultaneous profiles is the normal case.
| Profile | Activates | What it toggles |
|---|---|---|
|
Default (activated when no other profile given) |
Liquibase auto-apply with faker data context, local |
|
Explicit |
Production |
|
Explicit |
Skip Liquibase on startup (useful when schema is managed out-of-band) |
|
Explicit |
Enables |
|
Explicit |
Activates |
|
Explicit |
Pulls in |
|
Explicit |
Package as WAR instead of executable JAR (legacy; rarely used) |
|
|
Pulls in docker-compose-defined local dependencies (MySQL, Keycloak, MailHog) — auto-activated by the |
|
Explicit |
Overrides default H2 with local MySQL connection string |
|
Explicit |
Enables e2e test dependencies (Gatling, Cucumber) |
|
Explicit |
Cypress and headless runner setup |
|
Explicit |
IDE-specific overrides (typically disabling annotation processors that IDEs handle themselves) |
Typical production build: mvn -Pprod,api-docs,otlp package.
Typical CI test run: mvn -Papi-docs,test verify (the api-docs profile is required for OpenAPI spec extraction in test phase — see OpenAPI Contract Flow).
Typical dev run: ./mvnw (no explicit profile; dev activates by default).
4. Plugin Set
Every POM includes:
| Plugin | Purpose |
|---|---|
|
Build container image without a Docker daemon — see Jib Docker Build |
|
Schema migration; runs on startup by default, can be invoked explicitly for diff/generate-changelog |
|
Emit |
|
Read property files at build time for resource filtering |
|
Flags outdated Java API usage (optional; warn-level for now) |
|
Build / lint / template the per-service Helm chart during the package phase — see Helm Chart Structure |
|
Code-style enforcement (inherited from parent) |
Portals additionally include:
| Plugin | Purpose |
|---|---|
|
Download Node + npm, run |
Current Node / npm versions (from registration-portal pom): Node 22.15.0, npm 11.3.0. Bump carefully; Node upgrades have broken JHipster webpack setups in the past.
5. Version Strategy
project.version is bumped at release:
-
1.3.1→1.3.2-SNAPSHOTon develop after release -
CI on develop builds
-SNAPSHOTartefacts; deploys to dev/stage environments -
mvn -B release:prepare release:perform(via GitHub Actions — see the gitflow release pipeline) cuts the release
application.version in the logged banner is derived from project.version. git.properties (from git-commit-id-maven-plugin) provides commit SHA.
For the OpenAPI spec (see OpenAPI Contract Flow), info.version is derived from project.version too — so bumping the POM version automatically bumps the API spec version.
6. New Service Checklist
When creating admin-portal (or any new service):
-
Parent:
<parent>za.co.idealogic:event:1.3.x</parent>with emptyrelativePath -
<artifactId>inevent-*naming:event-admin-portal -
<packaging>jar</packaging> -
<properties>:<java.version>21</java.version>,<project.version>0.0.0-SNAPSHOT</project.version>, plus any service-specific properties -
<dependencies>: Spring Boot starter web, Hazelcast, Spring Session + Hazelcast, springdoc, the Spring Cloud Gateway MVC starter, OAuth2 client (for OIDC), parent-pom-provided commons -
<profiles>— copy the full set from registration-portal (reliable reference). Customise only where the service deviates; otherwise keep identical. -
<build><plugins>— copy the standard set from registration-portal. -
Jib configuration — bump the
<to><image>name todocker.io/christhonie/event-admin-portal. -
Helm chart placeholder under
src/main/helm/— see Helm Chart Structure. -
bootstrap.yml+bootstrap-prod.ymlundersrc/main/resources/config/— see SpringApplication Bootstrap.
Template the service off registration-portal’s layout; it is the newest JHipster 8.11 output and closest to what admin-portal will look like.
7. Deviations Worth Noting
| POM item | Why it deviates from stock JHipster |
|---|---|
Hazelcast-Hibernate-53 dependency (admin-service only) |
L2 cache provider not in stock JHipster 8 output; pinned to match Hazelcast 5.x |
|
Stock JHipster includes Micrometer integration but not the full OTel javaagent; we download and bake it into the image for auto-instrumentation |
|
Better template support for our per-environment values files |
|
The old |
Document deviations in the POM via XML comments. Future maintainers should know why something is non-stock.
8. Reference
| File | Role |
|---|---|
|
Parent POM; dependency + plugin management |
|
Reference for monolithic service POM with full profile set |
|
Reference for portal POM with |
|
Any parent-specific upgrade notes |