SkilVaultSign inStart free

Catalogue / flowlogix-base-pom

flowlogix-base-pom

Apache-2.0SignedConfigures, upgrades and troubleshoots Maven builds that let a parent POM carry the build — compiler, tests, code coverage, checkstyle and release configuration — so the project's own pom.xml stays small, using the general-purpose base-pom family of parent POMs (com.flowlogix base-pom and infra-pom…
---
name: flowlogix-base-pom
description: Configures, upgrades and troubleshoots Maven builds that let a parent POM carry the build — compiler, tests, code coverage, checkstyle and release configuration — so the project's own pom.xml stays small, using the general-purpose base-pom family of parent POMs (com.flowlogix base-pom and infra-pom for any Java project, payara-pom and glassfish-pom for Jakarta EE servers, quarkus-pom for Quarkus) and com.flowlogix.depchain dependency chains. Covers overriding properties, activating profiles such as server-local, server-docker, native and coverage, JaCoCo coverage, Arquillian and Testcontainers integration tests, server:dev, updating versions, and adopting the parent in an existing project. Use this skill whenever a pom.xml has a com.flowlogix parent, the user wants to move a Java project's build configuration into a shared parent POM, or mentions base-pom, infra-pom, payara-pom, glassfish-pom, quarkus-pom, depchain or server:dev. For anyone's projects, not only Flow Logix's.
license: Apache-2.0
compatibility: Works with any agent that supports Agent Skills and can run shell commands. Needs the project's Maven wrapper or Maven, network access to Maven Central, and a JDK at or above the parent POM's maven.compiler.release. Newer ones, such as 27, are fine.
metadata:
  source: https://github.com/flowlogix/skills/tree/main/plugins/jstarter/skills/flowlogix-base-pom
---

Maven parent POMs (base-pom)

A parent POM from the base-pom family carries the build (compiler, tests, coverage, checkstyle, server lifecycle), so the project's own pom.xml stays as small as possible. Anything not needed can be overridden or opted out. The POMs are published by Flow Logix, but are general-purpose: any project or company can use them, with its own coordinates, license header, SCM and release settings. base-pom and infra-pom work for any Java project, payara-pom and glassfish-pom add what Jakarta EE applications need to run and be tested on an application server, and quarkus-pom adds the Quarkus build.

Contents

  • Which situation is this?
  • Changing the build, in order of preference
  • Choosing a parent
  • Minimal POM and the parent version
  • Properties worth knowing
  • Profiles
  • Integration tests and application servers
  • Quarkus
  • Code coverage (JaCoCo)
  • Dependency chains (depchain) and the BOM
  • Adopting the parent POM in an existing project
  • Updating versions
  • Things that trip people up

Which situation is this?

  • `pom.xml` has `<parent><groupId>com.flowlogix</groupId>` → already uses one of these

parents, which says nothing about who owns the project. Change it by overriding properties or activating profiles, not by copying plugin configuration in.

  • Existing project without one of these parents → adopting one is a real migration: the parent

brings its own plugin versions, checkstyle and enforcer rules (JDK and Maven minimums). Confirm with the user first, then follow "Adopting the parent POM".

  • No project yet → generating one gives the parent ready-made, and that's the

flowlogix-new-project skill.

Changing the build, in order of preference

  1. Override a property (<maven.compiler.release>, <test.redirect.to.file>,

<maven.build.cache.enabled>, versions like <payara.version>).

  1. Activate a profile (-Pserver-docker, -Pcoverage, -Dcheckstyle.skip).
  2. Configure a plugin the parent already declares, only with the settings you change (e.g.

JaCoCo <includes>), without repeating its version.

  1. Only then add new plugins or dependencies. Omit <version> when the parent, or a BOM the project

imports, manages it.

Choosing a parent

base-pom ─► infra-pom ─┬─► server-common ─┬─► payara-pom
                       │                  └─► glassfish-pom
                       └─► quarkus-pom

| Parent | Use when | Adds | |---|---|---| | base-pom | any project, minimal, or as the parent of your own parent POM | compiler, sane plugin versions, no Maven 4 warnings | | infra-pom | opinionated build without an app server | Surefire/Failsafe (parallel), JaCoCo, checkstyle, enforcer (JDK/Maven minimum, dependency convergence, no JUnit 4), Mockito agent, src/demo sources, release/deploy profiles, managed versions (Jakarta EE, Lombok, Mockito) | | payara-pom / glassfish-pom | Jakarta EE apps tested against a real server | infra + server download/start/stop for ITs, Arquillian container, EclipseLink metamodel processor, server:dev | | quarkus-pom | Quarkus applications | infra + the Quarkus Maven plugin as an extension (quarkus packaging, quarkus:dev), the Jakarta EE Web API and BOM, the native profile (see "Quarkus") |

When unsure, the base-pom FAQ says start with base. For a Jakarta EE app with integration tests, payara or glassfish saves the most configuration, and for a Quarkus app, quarkus does.

Minimal POM and the parent version

<parent>
    <groupId>com.flowlogix</groupId>
    <artifactId>payara-pom</artifactId>
    <version>N</version> <!-- the latest release, LATEST does not work for a parent -->
</parent>

Versions are plain integers shared by all modules of base-pom, released about weekly, so find the current one instead of copying a number:

  • a generated project already has it
  • a project that already uses one of these parents: ./mvnw versions:update-parent (see "Updating versions")
  • adopting the parent: the <release> in

https://repo.maven.apache.org/maven2/com/flowlogix/base-pom/maven-metadata.xml on Maven Central

Properties worth knowing

Override these in <properties> instead of reconfiguring plugins. Their defaults move with the parent and a project may already override them, so ask the build for the value in effect: ./mvnw -q help:evaluate -Dexpression=<property> -DforceStdout.

| Property | Meaning | |---|---| | maven.compiler.release | target Java release, and the enforced minimum JDK (jdk.minimum.version) | | maven.minimum.version | enforced minimum Maven. Profile maven4-required raises it to Maven 4 | | jakarta.ee.version, lombok.version, mockito.version | managed versions | | test.redirect.to.file | test output to files (the starter sets false to see it on the console) | | junit5.parallel.tests.enabled, test.parallel, it.test.parallel, test.thread.count | test parallelism | | checkstyle.headerLocation | license header that checkstyle requires in Java files. The default is Flow Logix's own, so set it to the project's header file | | checkstyle.configLocation, checkstyle.suppressionsLocation, checkstyle.excludes | other checkstyle inputs | | maven.build.cache.enabled | Maven build cache extension switch (when the project uses it) | | arquillian.container, drone.browser | IT container and browser | | jacocoAddress, jacocoPort, jacocoReset | JaCoCo agent for coverage from a running server | | javadoc.doclint, japicmp.skip, jar.skip-if-empty, deploy.at-end | misc build toggles | | payara.version / glassfish.version | server version (server POMs) | | server.http.port, server.https.port | server ports used by ITs (server POMs) | | server.start.skip, testcontainers.skip | server lifecycle for ITs (server POMs) | | server.jdk.range | JDKs the server can run on, checked before it starts (server POMs) | | gpg.keyname, release.profile, staging.server, nexus.url | release settings. The defaults are Flow Logix's, so set them before releasing |

The complete tables are on https://docs.flowlogix.com/base-pom#section-variables.

Profiles

| Profile / switch | Effect | |---|---| | *(default, server POMs)* | download the server, start a domain, run ITs, stop it | | -Pserver-local | use an already-running local server (no download/start) | | -Pserver-remote | use a remote server (HTTPS port 443) | | -Pserver-docker | run the server in Docker via Testcontainers | | -Pcoverage | JaCoCo agent on the tests, and jacoco:merge set to collect **/*.exec. Merge and report run as explicit goals (below) | | -Dcheckstyle.skip | activates skip-checkstyle | | -Dnative | activates native: build a native executable (quarkus-pom) | | -Pmaven4-required | require Maven 4 | | -Dskinny.war | activates skinny-war: WAR without WEB-INF/lib jars, for quick redeploys in development with the jars on the server. For WARs in an EAR use ear.skinnyWars | | -Pdocs, -Prelease-plugins, release profiles | publishing, rarely needed in user projects |

-DskipITs skips integration tests and, in the server POMs, also skips starting the server.

Integration tests and application servers

  • Unit tests: *Test.java, run by Surefire in test.
  • Integration tests: *IT.java, run by Failsafe in verify, not test. The starter puts them in

<package>.its. They use Arquillian with @ArquillianSuiteDeployment (one deployment for the whole suite) and @AppServerLifecycle from depchain. flowlogix-jee (which flowlogix-datamodel includes) supplies the deployment from the POM's packaging, so a test needs a @Deployment method only to customize it, starting from ShrinkWrapManipulator.createDeployment().

  • First verify with a server POM downloads the server into target/dependency, so it is slow

once and quick after.

  • The server runs on the build's JDK, which must be in server.jdk.range (17 up to and including 25

as of parent 154). On a newer one, such as 27, the enforcer stops every build, even test. Keep the user's JDK, rather than looking for an older one. With a server that is already installed and running, use -Pserver-local (the tests deploy to it, so tell the user first). Otherwise use -Pserver-docker, for Payara with -Dserver.imageName=flowlogix/payara-full, which has JDK 27. With neither, use -DskipITs and say that the integration tests were not run. Either server needs a JDK at or above maven.compiler.release: GlassFish's image has 21.

  • base-pom, infra-pom and quarkus-pom bring no Arquillian container, so Arquillian tests fail

there until the project adds one. The starter generates its StarterIT only with the server POMs.

Quarkus

quarkus-pom builds on infra-pom, so its properties, coverage and checkstyle apply. The server-* profiles and server:dev do not.

  • Set <packaging>quarkus</packaging>. The Quarkus Maven plugin comes from the parent.
  • Develop with ./mvnw quarkus:dev, build a native executable with ./mvnw package -Dnative (needs

GraalVM or a container runtime).

  • The parent manages the Quarkus plugin, not the extensions. Import a BOM for those: the starter uses

com.flowlogix:flowlogix-quarkus-bom, and Quarkus's own io.quarkus.platform:quarkus-bom works too.

  • Test with @QuarkusTest, rather than Arquillian.
  • The Jakarta EE Web API is a compile dependency without its CDI API, which Quarkus supplies.

Code coverage (JaCoCo)

Unit and integration coverage (including code running inside an app server) are merged into one report. The project only needs to say which packages are its own:

<build>
  <plugins>
    <plugin>
      <groupId>org.jacoco</groupId>
      <artifactId>jacoco-maven-plugin</artifactId>
      <configuration>
        <includes><include>com/acme/**</include></includes>
        <excludes>
          <exclude>com/acme/*Test</exclude><exclude>com/acme/*Test$*</exclude>
          <exclude>com/acme/*IT</exclude><exclude>com/acme/*IT$*</exclude>
        </excludes>
      </configuration>
    </plugin>
  </plugins>
</build>

To run locally against Payara/GlassFish, the server has to be set up for JaCoCo once, with the script in https://docs.flowlogix.com/base-pom#_configuring_jacoco_code_coverage. It changes the user's server, so point them to it rather than running it. It needs groovy on the PATH. Then:

./mvnw verify -Dmaven.build.cache.enabled=false -Pserver-local,coverage

Preview shortened. The full SKILL.md is in the pack.