Skip to content

GH-3894: Prepare RC: stage through nexus-staging-maven-plugin - #3895

Merged
Fokko merged 3 commits into
apache:masterfrom
RussellSpitzer:feature/nexus-staging-plugin
Oct 28, 2026
Merged

Fokko merged 3 commits into
apache:masterfrom
RussellSpitzer:feature/nexus-staging-plugin

Conversation

@RussellSpitzer

Copy link
Copy Markdown
Member

Rationale for this change

prepare-rc.sh deploys with a plain mvn deploy, lets Nexus implicitly create a staging repository, and then guesses which open repository in the org.apache.parquet profile was created. This PR switches to using an explicit repository creation which returns the exact repo-id we need to validate.

Note: We don't need to do anything for Cancel or Release scripts since they already require the repo-id. Prepare is the only step which currently makes the repository without being sure which one it made.

What changes are included in this PR?

Maven Changes

  • Adds nexus-staging-maven-plugin 1.7.0 to the apache-release profile with extensions enabled. Replacing maven-deploy-plugin for mvn deploy under that profile

Automation Script Changes

  • prepare-rc.sh passes -DstagingDescription="Apache Parquet <version> RC<n>" and validates using the repository id (no check for a single repository or fail check)
  • If the deploy fails, or the ID cannot be read, the script names the repositories it created by reading the Created staging repository with ID lines from target/nexus-deploy.log
  • Removes nexus_find_open_staging_repo (and its one-open-repo guard) and nexus_close_staging_repo, which have no remaining callers.

Are these changes tested?

Yes.

  • New bats tests
  • I used my personal Apache credentials to do a test of the script using a throwaway 0.0.0-test version

Are there any user-facing changes?

For release managers only. release:perform also activates the apache-release profile, so a manual release now stages through the plugin too:

  • release:perform closes the staging repository itself, so the manual "Close" step in Nexus is no longer needed.
  • To give the repository the description the release scripts expect, pass it through: ./mvnw release:perform -DskipTests -Darguments="-DskipTests -DstagingDescription='Apache Parquet <version> RC<n>'".
  • The repository ID for the vote email is printed in the Maven output.

Steps 2 and 3 of the release guide need a follow-up update in the parquet-site repository.

Closes #3894

🤖 Generated in tandem with Claude Code

A plain `mvn deploy` to repository.apache.org relies on Nexus implicitly
creating a staging repository, and never tells the client which one it
used. prepare-rc.sh then had to guess: nexus_find_open_staging_repo
listed every open repository in the org.apache.parquet profile and
refused to continue unless there was exactly one.

That guess fails in two ways. On 2026-09-10 a single 1.19.0 run ended
with two open repositories (orgapacheparquet-1085 and -1086) and aborted
before closing either. And parquet-format publishes under the same
groupId, so it shares the staging profile: any open repository from a
parquet-format release would block a parquet-java release, or be
mistaken for one. GitHub concurrency groups are per repository, so the
workflows cannot serialize across the two.

Add nexus-staging-maven-plugin 1.7.0 to the apache-release profile with
extensions enabled, so it replaces maven-deploy-plugin for `mvn deploy`
under that profile only. It stages every module locally, opens one
staging repository, uploads into it, closes it, and records the
repository ID in target/nexus-staging/staging/<profileId>.properties.
prepare-rc.sh now reads the ID from that file rather than searching for
it, which removes nexus_find_open_staging_repo and its multiple-repo
guard.

The plugin also takes over the close from our bulk-close call. Its close
waits for completion and prints rule failures (such as the missing
public key on 2026-09-14), where the bulk call returned while the close
was still in progress. keepStagingRepositoryOnCloseRuleFailure keeps a
repository that fails a rule so it can be inspected, and the properties
file is written before the close, so a failed close still reports which
repository was left behind. stagingProgressTimeoutMinutes is raised from
5 to 15 because a 16-module close may run past the default.

-DstagingDescription sets "Apache Parquet <version> RC<n>" on the
repository at creation, which is the description cancel-rc.sh and
publish-release.sh verify. After the deploy, prepare-rc.sh runs the same
nexus_verify_staging_repo check against the new repository.

stagingProfileId is left unset, so the plugin resolves the profile from
the groupId through the profile_evaluate endpoint. If the deployer
account cannot call that endpoint, the next run fails before uploading
anything and the profile ID has to be configured explicitly.

nexus_close_staging_repo had no remaining callers and is removed.
cancel-rc.sh and publish-release.sh already take the repository ID as an
argument and are unchanged.

Generated-by: Claude Opus 5.5 (1M context)
On a close rule failure, nexus-staging-maven-plugin 1.7.0 deletes its
staging properties file in afterUploadFailure before deciding whether to
keep the repository. With keepStagingRepositoryOnCloseRuleFailure set,
that is exactly the case where a repository is left behind, so reading
the properties file on the failure path could never report it, and
printed a misleading "Expected one staging properties file" error
instead.

maven_deploy now tees Maven output to target/nexus-deploy.log, and the
failure path reads every ` * Created staging repository with ID "..."`
line from it. The plugin logs that line for each repository it opens,
before any upload, so it survives every failure mode. The message says
to check whether the repository still exists, because some failures
(an upload IOException) drop it automatically. PIPESTATUS keeps mvnw's
exit status through the tee regardless of pipefail.

Set autoReleaseAfterClose=false explicitly. It is the default, but the
plugin also binds it to -DautoReleaseAfterClose, and a release after
close would publish an RC before the vote; configuration in the pom
takes precedence over the user property.

The plugin version moves to a nexus-staging-maven-plugin.version
property like the other build plugins. The step summary now reports
success only after nexus_verify_staging_repo passes, and records a line
for each failure exit.

Tests cover the stale staging directory being cleared, the description
reaching mvnw as one argument, mvnw's exit status propagating through
the tee, more than one properties file, the default staging directory,
and parsing repository IDs from the deploy log.

Generated-by: Claude Opus 5.5 (1M context)
When the deploy succeeds but maven_read_staging_repo_id fails, the step
summary only said to look in the Maven log. The deploy log already
records every repository the plugin created, so report those IDs the
same way the deploy failure path does.

If the log shows no created repository either, nexus-staging-maven-plugin
most likely did not run and maven-deploy-plugin deployed into a
repository Nexus created implicitly, so say that and point at Nexus.

Generated-by: Claude Opus 5.5 (1M context)
Comment thread pom.xml
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it automatically pick up the credentials?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, or I should say it uses the same ENV variables we are already setting.

@Fokko
Fokko merged commit 86aa26e into apache:master Oct 28, 2026
6 checks passed
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.

Release scripts: stage RCs through nexus-staging-maven-plugin

2 participants