The generated promote script fails to release the staging repository on JDK 17 and later

Open
#1,757 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java, shell, wasm
Domain
tooling

Research direction

The pinned plugin call is at line 74 of release.sh, which generates promote-$version.sh; the rc-drop call in the generated revert script needs the same check. Start by reproducing the rc-release failure on JDK 17 or later and confirming that the MAVEN_OPTS add-opens flags make it pass with 1.7.0. Done means the generated promote and revert scripts use one plugin version and the required opens, on both master and wicket-10.x.

Written by the indexing model from the issue text.

Description

The promote-$version.sh that release.sh generates fails at the Nexus release step when Maven runs on JDK 17 or later, and with set -e (#1749) it stops there. By then the tag is pushed and the distribution has moved to dist/release, but the staging repository isn't released and the next development version isn't set.

release.sh line 74 pins the plugin for that step:

mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:rc-release -DstagingRepositoryId=$stagingrepoid ...

while rc-list, rc-close and rc-drop use LATEST. Version 1.6.7 bundles xstream 1.4.7, which can't run on a current JDK:

An API incompatibility was encountered while executing org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:rc-release: java.lang.ExceptionInInitializerError: null
... Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module

Moving to 1.7.0 (LATEST) is not enough on its own. rc-list and rc-close work with it, but rc-release serializes a list through xstream and fails the same way:

Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.7.0:rc-release ... No converter available
type      : java.util.Arrays$ArrayList
message[1]: Unable to make field protected transient int java.util.AbstractList.modCount accessible: module java.base does not "opens java.util" to unnamed module

It succeeds with 1.7.0 when the JVM opens the packages xstream reflects on:

MAVEN_OPTS="--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED" \
  mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.7.0:rc-release ...

The generated promote script should use the same plugin version as the other steps and pass these options for the release step. rc-drop in the generated revert script runs the same plugin and should be checked for the same failure. Both master and wicket-10.x have the pin.

Found while promoting 11.0.0. Follows up on #1749.

Dominant language
Java
Stars
800
Forks
437
Avg merge
21h 36m
Merged PRs (30d)
167

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/wicket

All issues in apache/wicket

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.