Skip to content

fix(ci): use sed to update parent POM version instead of versions:update-parent#969

Draft
Copilot wants to merge 2 commits into
java2xfrom
copilot/fix-failing-github-actions-job
Draft

fix(ci): use sed to update parent POM version instead of versions:update-parent#969
Copilot wants to merge 2 commits into
java2xfrom
copilot/fix-failing-github-actions-job

Conversation

Copilot AI commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

CI fails at "Download dependencies and setup the various pom.xml" because mvn versions:update-parent requires the parent POM to be resolvable before it can even start. killbill-api on java2x declares parent 0.147.0-8d4551b-SNAPSHOT which doesn't exist in any accessible repository — Maven cannot load the project model to execute the goal.

Change

  • Replace mvn versions:update-parent with a sed command that directly edits the <version> inside the <parent> block of each pom.xml. This eliminates the chicken-and-egg problem where Maven needs to resolve the old parent before it can update to the new one.
# Before: versions:update-parent fails because Maven can't parse the POM
mvn versions:update-parent -DparentVersion="[$pomVersion]"  # ← exit 1 (can't resolve old parent)

# After: sed edits the XML directly, no Maven resolution needed
sed -i "/<parent>/,/<\/parent>/s|<version>.*</version>|<version>$pomVersion</version>|" pom.xml

Why other jobs in the same run succeeded

The failure is non-deterministic. It depends on whether Sonatype OSSRH snapshots still has the old parent artifact cached. Jobs that got a fast 404 failed immediately (attempt 1 postgresql: 1s); the mysql job hung for 60s on the wagon timeout before failing. Jobs where the snapshot repo happened to serve the artifact succeeded. This fix eliminates the external dependency entirely.

The CI was failing because `mvn help:evaluate` requires the parent POM
to be resolvable. When killbill-api references a parent version like
0.147.0-8d4551b-SNAPSHOT that doesn't exist in any accessible repository,
the evaluate command fails with exit code 1.

The fix moves `versions:update-parent` before `help:evaluate` so that
the parent is updated to the locally-installed killbill-oss-parent
version before Maven tries to resolve it.
@xsalefter

Copy link
Copy Markdown
Contributor

@copilot still failing. Can you check?

…ate-parent

The versions:update-parent Maven goal fails when the currently declared parent
POM is unresolvable (e.g. 0.147.0-8d4551b-SNAPSHOT not in any repository).
Maven cannot even load the project model to start the goal.

Replace with a sed command that directly edits the <version> inside the
<parent> block of pom.xml. This eliminates the chicken-and-egg problem
where Maven needs to resolve the old parent before it can update to the
new one.

Copilot AI commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot still failing. Can you check?

The root cause is that mvn versions:update-parent itself requires the POM to be parseable — Maven needs to resolve the currently-declared parent (0.147.0-8d4551b-SNAPSHOT) before it can even start the goal. Since that artifact doesn't exist in any accessible repo, Maven fails immediately.

Fixed in 8a4e28b by replacing mvn versions:update-parent with a sed command that directly edits the <version> inside the <parent> block of pom.xml. This eliminates the dependency on Maven being able to resolve the old parent.

Copilot AI changed the title fix(ci): update parent POM before evaluating project version fix(ci): use sed to update parent POM version instead of versions:update-parent Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants