`license-mapping.json` maps classpath-exception license names to the deprecated SPDX id `GPL-2.0-with-classpath-exception`
Maintainer thường phản hồi trong vòng 2 ngày
@afalhambra-hivemq đang làm issue này rồi.
Từ ngày 20/11/2026.
- #999 của @afalhambra-hivemq — đang mở
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with src/main/resources/license-mapping.json and LicenseResolverTest; the issue names nine mappings and describes the replacement SPDX expressions. Before changing them, read how resolver results are consumed and how LicenseChoice.setExpression(...) affects components with multiple licenses. Done means all nine names resolve to the proposed expressions, with tests covering each mapping; the issue flags plugin changes as a release coordination concern.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
LicenseResolver fuzzy-matches license names through src/main/resources/license-mapping.json. Nine names resolve to GPL-2.0-with-classpath-exception, an id SPDX deprecated in license list version 2.0rc2 (the bundled licenses/licenses.json, 3.29.0, flags it isDeprecatedLicenseId):
- "GPL2 w/ CPE", "GPLv2+CE", "GPLv2 with classpath exception", "GPLv2 license, includes the CLASSPATH exception", "GNU General Public License, version 2, with the Classpath Exception", "GNU General Public License, version 2 with the GNU Classpath Exception" and "GPL v2 with the Classpath exception" map to
GPL-2.0-with-classpath-exception. - "CDDL + GPLv2 with classpath exception" and "CDDL/GPLv2+CE" map to
(CDDL-1.0 OR GPL-2.0-with-classpath-exception).
For example, jakarta.annotation:jakarta.annotation-api declares "GPL2 w/ CPE", so BOMs built from its POM carry the deprecated id.
Proposed fix
Use the replacements SPDX names in its own data. In spdx/license-list-XML, GPL-2.0-with-classpath-exception.xml is obsoleted by GPL-2.0 WITH Classpath-exception-2.0, and GPL-2.0.xml is obsoleted by GPL-2.0-only. So:
GPL-2.0-with-classpath-exceptionbecomes(GPL-2.0-only WITH Classpath-exception-2.0)(CDDL-1.0 OR GPL-2.0-with-classpath-exception)becomes(CDDL-1.0 OR GPL-2.0-only WITH Classpath-exception-2.0)
A PR with this change and LicenseResolverTest cases for all nine names will follow.
Behaviour change for callers
WITH cannot appear in a license id, so the new values must be parenthesised expressions, and LicenseResolver returns those as an Expression instead of a License. The seven names that resolve to a license object today will resolve to an expression.
Both build plugins handle an expression result with LicenseChoice.setExpression(...), which replaces every license already collected for the component:
- cyclonedx-gradle-plugin:
MavenHelper.java#L229-L231 - cyclonedx-maven-plugin:
DefaultModelConverter.java#L412-L413(for CycloneDX 1.0 output it skips expressions and falls back to a name-only license)
jakarta.annotation-api 3.0.0 lists "EPL 2.0" before "GPL2 w/ CPE", so with this change alone its BOM would lose EPL-2.0. From reading the code, the same loss already happens today to any POM that lists one of the two CDDL names after another license; this change extends it to seven more names. I suggest merging this after the plugins stop dropping licenses when a POM lists several (cyclonedx-gradle-plugin: CycloneDX/cyclonedx-gradle-plugin#979, fixed by CycloneDX/cyclonedx-gradle-plugin#980; cyclonedx-maven-plugin has no issue yet), or releasing both together.
Two more names, missing from the table
Two names that POMs in the wild use are not in license-mapping.json at all, so BOMs carry them as bare names without an SPDX id: "GNU General Public License, Version 2 with the Classpath Exception" (org.jboss.resteasy:resteasy-tracing-api), which belongs with the classpath-exception names above, and "GNU General Public License, version 2" (org.rocksdb:rocksdbjni), which maps to GPL-2.0-only. The PR adds both.
Side note, not part of this fix
The CDDL half maps to CDDL-1.0, but some artifacts using "CDDL + GPLv2 with classpath exception" ship CDDL 1.1. For example, the javax.annotation:javax.annotation-api:1.3.1 POM points at https://github.com/javaee/javax.annotation/blob/master/LICENSE, which is CDDL Version 1.1. The name alone can't tell the two versions apart, so the fix doesn't touch it.
- Ngôn ngữ chính
- Java
- Star
- 124
- Fork
- 97
- Merge trung bình
- 2 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 CycloneDX/cyclonedx-core-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
CycloneDX/cyclonedx-core-java#1002 ·
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 78/100
CycloneDX/cyclonedx-core-java#1001 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
CycloneDX/cyclonedx-core-java#902 ·
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 58/100
CycloneDX/cyclonedx-core-java#848 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Partial serializationĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
CycloneDX/cyclonedx-core-java#838 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của CycloneDX/cyclonedx-core-java
Issue tương tự
-
crash
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Modern `HttpServletMcpTransport` does not check `Mcp-Name` when `params.name` or `params.uri` is not a JSON stringCó thể đã có người làm @starryeye đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/java-sdk#1352 · 1 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 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
account bug course exam iris lecture
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày