Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

only-script for Linux clobbers MVNW_REPOURL

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

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

@bmarwell đang làm issue này rồi.

Từ ngày 8/6/2026.

  • #415 của @armorbreak001 — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug
Affected version

3.3.3

Bug description

Running the Maven Wrapper plugin through the Maven Wrapper's only-script distribution type causes MVNW_REPOURL to be discarded, leaving the distributionUrl written to maven-wrapper.properties at its default value. Consequently, only-script for Linux is unable to update itself in any environment that needs MVNW_REPOURL.

That is, the hypothetical execution

$ MVNW_REPOURL=asdfasdf ./mvnw org.apache.maven.plugins:maven-wrapper-plugin:3.3.3:wrapper -Dtype=only-script -Dmaven=3.9.11 -X

where asdfasdf is a functional mirror should have produced an output similar to

...
[DEBUG] Using repo URL from MVNW_REPOURL environment variable.
[DEBUG] Determined repo URL to use as asdfasdf
[INFO] Configuring .mvn/wrapper/maven-wrapper.properties to use Maven 3.9.11 and download from asdfasdf

but will end up producing

...
[DEBUG] Determined repo URL to use as https://repo.maven.apache.org/maven2
[INFO] Configuring .mvn/wrapper/maven-wrapper.properties to use Maven 3.9.11 and download from https://repo.maven.apache.org/maven2

and the result is consistent with the log messages.

This happens because only-mvnw explicitly unsets MVNW_REPOURL:

https://github.com/apache/maven-wrapper/blob/maven-wrapper-3.3.3/maven-wrapper-distribution/src/resources/only-mvnw#L149

so by the time WrapperMojo tries to read the variable it sees null:

https://github.com/apache/maven-wrapper/blob/maven-wrapper-3.3.3/maven-wrapper-distribution/src/resources/only-mvnw#L149

As far as I can see, this bug does not exist in only-mvnw.cmd.

The issue is exacerbated by the user property distributionUrl value representing the "final" URl. That is, it is not simply a domain substitution and therefore cannot take the place of MVNW_REPOURL.

Ngôn ngữ chính
Java
Star
253
Fork
77
Merge trung bình
22 giờ 10 phút
Pull request đã merge (30 ngày)
7

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

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

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/maven-wrapper

Tất cả issue của apache/maven-wrapper

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.