A second build without clean fails in resources-optimizer-maven-plugin because minified files are minified again
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu với resourcesSet của optimizer trong pom.xml ở thư mục gốc và quy tắc loại trừ **/jquery*.js hiện có. Tái hiện bằng hai lệnh Maven trong issue, lần đầu có clean, lần sau không có. Loại trừ **/*.min.js và **/*.min.css; hoàn tất khi lần build thứ hai thành công mà không xử lý các tệp đã minify từ trước hoặc thêm mục *.min.min.* vào các JAR.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
A second mvn install without clean fails in wicket-extensions, in the resources-optimizer-maven-plugin:
mvn clean install -DskipTests -Pfast -pl wicket-extensions -am # succeeds
mvn install -DskipTests -Pfast -pl wicket-extensions -am # fails
[ERROR] JSC_NON_CONST_DEFINE. @define $jscomp.ASSUME_ES5 has already been set at src/com/google/javascript/jscomp/js/util/defines.js:25:8. at .../wicket-extensions/target/classes/org/apache/wicket/extensions/ajax/veil/wicket-veil.min.js line 1 : 243
...
[ERROR] Failed to execute goal org.primefaces.extensions:resources-optimizer-maven-plugin:2.7.9:optimize (default) on project wicket-extensions: Resources optimization failure: Resources optimization failure. Please fix errors and try again.
Cause
The optimizer reads its input from ${project.build.directory}/classes, the directory it also writes its .min output to, and the root pom.xml excludes only **/jquery*.js. On a build without clean, the .min.js and .min.css files of the previous run are therefore minified again, as *.min.min.js and *.min.min.css. The log of the second run shows it, e.g. Optimize JS file wicket-ajax-jquery.min.js ....
Most files survive being minified twice, but wicket-veil.js uses for ... of with destructuring, so Closure injects its $jscomp polyfills, including @define constants, into wicket-veil.min.js. Compiling that output again redefines those constants, which Closure reports as an error.
Modules that do get past the optimizer ship the doubled files: after the second run, the installed wicket-core jar contains 9 *.min.min.* entries, e.g. wicket-ajax-jquery.min.min.js.
CI always builds from a clean checkout, so it never sees this.
Suggested fix
Exclude **/*.min.js and **/*.min.css in the optimizer's resourcesSet in the root pom.xml, next to the existing **/jquery*.js exclusion.
This replaces #1718, whose title describes this problem but whose description is about an unrelated javadoc failure.
- Ngôn ngữ chính
- Java
- Star
- 799
- Fork
- 421
- Merge trung bình
- 20 giờ 5 phút
- Pull request đã merge (30 ngày)
- 125
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/wicket
-
COOP and COEP exemptions compare with the context path, so page exemptions never matchCó thể đã có người làm @asvanberg đã nhận 16 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
apache/wicket#1661 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The CSP report-uri is lost in development mode because strict() clears itCó thể làm lại được @VelpulaGangavardhan đã nhận 21 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/wicket#1660 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/wicket#1567 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/wicket
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
NationalSecurityAgency/ghidra#10149 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
yegor256/antlr2ebnf-maven-plugin#155 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
account bug exercise lecture programming user interface
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ls1intum/Artemis#14512 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind:bug priority:major
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
swiftlang/swift-java#955 ·
Maintainer thường phản hồi trong vòng 1 ngày