Skip to content

Apply maven-args to the Set up Maven step#271

Merged
hboutemy merged 1 commit into
apache:v4from
aschemaven:v4-pass-maven-args-to-setup
Jun 27, 2026
Merged

Apply maven-args to the Set up Maven step#271
hboutemy merged 1 commit into
apache:v4from
aschemaven:v4-pass-maven-args-to-setup

Conversation

@ascheman

Copy link
Copy Markdown
Contributor

Problem

The Set up Maven step bootstraps the Maven wrapper by running the runner's
system mvn against maven-wrapper-plugin:wrapper:

- name: Set up Maven
  run: mvn … maven-wrapper-plugin:3.3.4:wrapper "-Dmaven=${{ matrix.maven }}"

Running any goal in a project directory forces Maven to read the project model,
which includes resolving the parent POM — even though the goal itself only
writes wrapper files. This step does not pass ${{ inputs.maven-args }},
unlike the later Build with Maven / Build Maven Site steps.

So a caller that injects a custom settings file via maven-args
(e.g. -s .github/settings.xml to reach a staged Apache parent POM during a
simultaneous Apache-parent / project-parent vote) cannot influence parent
resolution in this first step. The bootstrap then fails with
Non-resolvable parent POM … org.apache:apache:pom:39 … in central before the
actual build ever runs.

Concrete failure: apache/maven-parent#578
https://github.com/apache/maven-parent/actions/runs/28279903879/job/83793460535

Fix

Pass ${{ inputs.maven-args }} to the wrapper bootstrap in both the
fail-fast-build and verify jobs. The default value
(-D"invoker.streamLogsOnFailures") is benign, so this is a no-op for callers
that do not set maven-args.

The "Set up Maven" step bootstraps the Maven wrapper by running the
runner's system mvn against maven-wrapper-plugin:wrapper. Running any
goal in a project directory forces Maven to read the project model,
which includes resolving the parent POM -- but this step did not pass
${{ inputs.maven-args }}, unlike the later "Build with Maven" /
"Build Maven Site" steps.

A caller that injects a custom settings file via maven-args (for
example -s .github/settings.xml to reach a staged Apache parent POM
during a simultaneous parent vote) therefore could not influence parent
resolution in this first step, so the bootstrap failed with a
Non-resolvable parent POM error before the actual build ran.

Pass ${{ inputs.maven-args }} to the wrapper bootstrap in both the
fail-fast-build and verify jobs. The default value is benign, so this
is a no-op for callers that do not set maven-args.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hboutemy

Copy link
Copy Markdown
Member

thank you

@hboutemy hboutemy merged commit 405f247 into apache:v4 Jun 27, 2026
67 checks passed
hboutemy added a commit that referenced this pull request Jun 27, 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