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

Đang mở
#1,757 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, shell, wasm
Lĩnh vực
tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
799
Fork
420
Merge trung bình
18 giờ 37 phút
Pull request đã merge (30 ngày)
140

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/wicket

Tất cả issue của apache/wicket

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.