build: flatten published poms so snapshots resolve (QRun-IO/qqq#785) #4

Merged
KofTwentyTwo merged 2 commits from feature/GH-785-flatten-published-poms into develop 2026-09-26 07:12:28 +00:00
KofTwentyTwo commented 2026-09-26 07:06:28 +00:00 (Migrated from github.com)

Closes QRun-IO/qqq#785
Part of QRun-IO/qqq-all#1

Summary

The only published qbit-geo-data build (0.2.0-SNAPSHOT) cannot be resolved: qbit-geo-data and qbit-geo-data-tools name their parent as qbit-geo-data-parent:${revision}. This adds flatten-maven-plugin 1.7.3 to the root pom, configured the same way as the qqq root pom (flattenMode resolveCiFriendliesOnly, updatePomFile true, flatten bound to process-resources, clean bound to clean), so installed and published poms carry the real version.

Changes

  • pom.xml: flatten-maven-plugin in <build><plugins>, inherited by both modules.
  • .gitignore: ignore the generated .flattened-pom.xml files.
  • CHANGELOG.md: Fixed entry under Unreleased.
  • CircleCI already has the needrestart configure-package-install pre-step on every job, so .circleci/config.yml is unchanged.

Verification

Evidence comes from local builds. CI on develop publishes the new snapshot after merge, and that snapshot can only be checked from Central afterwards. No mvn install was run; the deploy checks went to a throwaway file repository.

Command Result
Before the change: mvn -B -q -DskipTests package deploy:deploy -DaltDeploymentRepository=local::file:///tmp/geo-b7b-before Deployed qbit-geo-data and qbit-geo-data-tools poms contain <parent>...<version>${revision}</version> (reproduces the bug)
After: mvn -B -DskipTests package deploy:deploy -DaltDeploymentRepository=local::file:///tmp/geo-b7b-after BUILD SUCCESS; all 3 deployed poms have 0 ${revision}: parent pom version 0.2.0-SNAPSHOT (its parent qbit-build-parent:2.0.0), both module poms have parent version 0.2.0-SNAPSHOT
mvn -B -q clean Removes all .flattened-pom.xml files (0 left)
mvn -B verify BUILD SUCCESS, Tests run: 28, Failures: 0, Errors: 0, Skipped: 0
mvn -B -Pqqq-snapshot verify BUILD SUCCESS, Tests run: 28, Failures: 0, Errors: 0, Skipped: 0 (qqq-backend-core resolved as 4.1.0-SNAPSHOT)
mvn -B -DskipTests package, then inspected ./.flattened-pom.xml, qbit-geo-data-core/.flattened-pom.xml, tools/.flattened-pom.xml Each has a concrete parent version (2.0.0, 0.2.0-SNAPSHOT, 0.2.0-SNAPSHOT) and no ${revision}; the only difference from the source module pom is the parent version

After merge

Confirm that the new develop snapshot of com.kingsrook.qbits:qbit-geo-data:0.2.0-SNAPSHOT resolves from https://central.sonatype.com/repository/maven-snapshots/ and that its pom names qbit-geo-data-parent:0.2.0-SNAPSHOT.

Closes QRun-IO/qqq#785 Part of QRun-IO/qqq-all#1 ## Summary The only published qbit-geo-data build (0.2.0-SNAPSHOT) cannot be resolved: `qbit-geo-data` and `qbit-geo-data-tools` name their parent as `qbit-geo-data-parent:${revision}`. This adds flatten-maven-plugin 1.7.3 to the root pom, configured the same way as the qqq root pom (`flattenMode` `resolveCiFriendliesOnly`, `updatePomFile` true, `flatten` bound to `process-resources`, `clean` bound to `clean`), so installed and published poms carry the real version. ## Changes - `pom.xml`: flatten-maven-plugin in `<build><plugins>`, inherited by both modules. - `.gitignore`: ignore the generated `.flattened-pom.xml` files. - `CHANGELOG.md`: Fixed entry under Unreleased. - CircleCI already has the needrestart `configure-package-install` pre-step on every job, so `.circleci/config.yml` is unchanged. ## Verification Evidence comes from local builds. CI on develop publishes the new snapshot after merge, and that snapshot can only be checked from Central afterwards. No `mvn install` was run; the deploy checks went to a throwaway file repository. | Command | Result | |---|---| | Before the change: `mvn -B -q -DskipTests package deploy:deploy -DaltDeploymentRepository=local::file:///tmp/geo-b7b-before` | Deployed `qbit-geo-data` and `qbit-geo-data-tools` poms contain `<parent>...<version>${revision}</version>` (reproduces the bug) | | After: `mvn -B -DskipTests package deploy:deploy -DaltDeploymentRepository=local::file:///tmp/geo-b7b-after` | BUILD SUCCESS; all 3 deployed poms have 0 `${revision}`: parent pom version `0.2.0-SNAPSHOT` (its parent `qbit-build-parent:2.0.0`), both module poms have parent version `0.2.0-SNAPSHOT` | | `mvn -B -q clean` | Removes all `.flattened-pom.xml` files (0 left) | | `mvn -B verify` | BUILD SUCCESS, Tests run: 28, Failures: 0, Errors: 0, Skipped: 0 | | `mvn -B -Pqqq-snapshot verify` | BUILD SUCCESS, Tests run: 28, Failures: 0, Errors: 0, Skipped: 0 (qqq-backend-core resolved as 4.1.0-SNAPSHOT) | | `mvn -B -DskipTests package`, then inspected `./.flattened-pom.xml`, `qbit-geo-data-core/.flattened-pom.xml`, `tools/.flattened-pom.xml` | Each has a concrete parent version (2.0.0, 0.2.0-SNAPSHOT, 0.2.0-SNAPSHOT) and no `${revision}`; the only difference from the source module pom is the parent version | ## After merge Confirm that the new develop snapshot of `com.kingsrook.qbits:qbit-geo-data:0.2.0-SNAPSHOT` resolves from https://central.sonatype.com/repository/maven-snapshots/ and that its pom names `qbit-geo-data-parent:0.2.0-SNAPSHOT`.
KofTwentyTwo commented 2026-09-26 07:12:02 +00:00 (Migrated from github.com)

Review round 1 (B7b, QRun-IO/qqq#785): approve. No blocking issues.

The flatten config matches the qqq root pom exactly, and it fixes the unresolvable parent reference. I checked it on a clean clone of 7429532:

Check Result
mvn -B verify, mvn -B -T4 clean verify (the orb's flags), mvn -B -Pqqq-snapshot verify BUILD SUCCESS, 28 tests pass in each; the profile resolves qqq-backend-core 4.1.0-SNAPSHOT
package deploy:deploy to a file repo No ${revision} in the 3 poms; modules name qbit-geo-data-parent:0.2.0-SNAPSHOT; the parent pom keeps the qqq-snapshot profile
Orb flow: versions:set-property -Dproperty=revision to a feature version, then deploy Only pom.xml shows as modified (flattened files are ignored); the deployed poms carry the new version
Consumer project with an empty local repo, against that file repo Resolves qbit-geo-data and qbit-geo-data-tools
Same consumer against Central snapshots today Fails with qbit-geo-data-parent:pom:${revision} not found, so the bug reproduces
mvn clean Removes every .flattened-pom.xml
CircleCI test_only Pass

Non-blocking:

  • Closes QRun-IO/qqq#785 won't close the issue when this merges to develop, because the default branch is main. That's fine here: close #785 by hand once the new develop snapshot resolves from Central.
  • No automated test covers the published pom shape. For a build-config change, the deploy and consumer checks above are enough.
**Review round 1 (B7b, QRun-IO/qqq#785): approve. No blocking issues.** The flatten config matches the qqq root pom exactly, and it fixes the unresolvable parent reference. I checked it on a clean clone of `7429532`: | Check | Result | |---|---| | `mvn -B verify`, `mvn -B -T4 clean verify` (the orb's flags), `mvn -B -Pqqq-snapshot verify` | BUILD SUCCESS, 28 tests pass in each; the profile resolves qqq-backend-core 4.1.0-SNAPSHOT | | `package deploy:deploy` to a file repo | No `${revision}` in the 3 poms; modules name `qbit-geo-data-parent:0.2.0-SNAPSHOT`; the parent pom keeps the `qqq-snapshot` profile | | Orb flow: `versions:set-property -Dproperty=revision` to a feature version, then `deploy` | Only `pom.xml` shows as modified (flattened files are ignored); the deployed poms carry the new version | | Consumer project with an empty local repo, against that file repo | Resolves `qbit-geo-data` and `qbit-geo-data-tools` | | Same consumer against Central snapshots today | Fails with `qbit-geo-data-parent:pom:${revision}` not found, so the bug reproduces | | `mvn clean` | Removes every `.flattened-pom.xml` | | CircleCI `test_only` | Pass | Non-blocking: - `Closes QRun-IO/qqq#785` won't close the issue when this merges to `develop`, because the default branch is `main`. That's fine here: close #785 by hand once the new develop snapshot resolves from Central. - No automated test covers the published pom shape. For a build-config change, the deploy and consumer checks above are enough.
Sign in to join this conversation.