btlqql opened a new pull request, #5341:
URL: https://github.com/apache/rocketmq-dashboard/pull/5341

   ### Which Issue(s) This PR Fixes
   
   - Fixes #5085
   
   ### Brief Description
   
   `server/pom.xml` bound the binary license gate to the default `package` 
phase (maven-antrun execution `binary-license-gate`, `server/pom.xml:237`), so 
`mvn package` ran `scripts/legal.py jar` on every build. That gate requires a 
complete upstream license text (a LICENSE/COPYING file of at least 300 bytes) 
inside **every** JAR bundled into the fat JAR, plus a copy of the Boot loader's 
own license. Most Maven-published JARs do not embed one, so the gate fails on 
164 components and `mvn package` never completes — for every developer, for 
CI's `Backend Build` job (`mvn -B -ntp clean package -DskipTests`) and for the 
`server/Dockerfile` build stage (`mvn package -DskipTests`).
   
   This PR keeps the gate exactly as it is and moves it into an opt-in 
`binary-license-gate` profile, which is one of the directions the issue lists 
("require license materials only for a defined release profile"):
   
   ```xml
   <profiles>
       <profile>
           <id>binary-license-gate</id>
           ...
       </profile>
   </profiles>
   ```
   
   `mvn package` is a developer/CI build again; a release check runs it as `mvn 
-Pbinary-license-gate package` (still bound to `package`, still failing on the 
same 164 components until the texts are vendored — see the control run below). 
Sourcing and verifying those 164 license texts is a compliance decision this PR 
deliberately does not make, and `server/scripts/legal.py` is untouched.
   
   What this PR does **not** change: the container build still enforces the 
gate. `server/Dockerfile` runs `python3 /opt/studio-legal/scripts/legal.py 
check-jar /app/app.jar --output /usr/share/licenses/rocketmq-studio` on the 
packaged JAR after `mvn package`, and that check recomputes the same manifest 
and fails on the same missing texts. So the redistribution path stays gated; 
the Docker image build will keep failing at the license check until the texts 
exist.
   
   Note for CI: `.github/workflows/ci.yml` runs `mvn -B -ntp clean package 
-DskipTests`, so with this change the gate no longer runs in the build job. If 
the project wants the build job to keep enforcing it, that job needs 
`-Pbinary-license-gate`; the workflow file is outside the files I own, so I did 
not touch it.
   
   ### How Did You Test This Change?
   
   This is a build-wiring change, so the evidence is the two build runs (plus a 
control run proving the gate itself is untouched). The environment is Windows, 
where `python3` resolves to the Microsoft Store alias stub, so the runs pass 
the pom's existing `-Dlicense.python=python` property (Python 3.13.7); this 
only selects the interpreter and does not change the gate's behaviour. On Linux 
CI the default `python3` is used.
   
   Red — unmodified tree, the gate fails the build on 164 components:
   
   ```
   $ cd server && mvn -B -ntp package -DskipTests -Dlicense.python=python
   [INFO] Building jar: ...\target\rocketmq-studio-3.0.0.jar
   [INFO]      [exec] license gate: release license gate failed:
   [INFO]      [exec] HikariCP-7.0.2.jar: missing complete upstream 
LICENSE/COPYING; a POM name or link is not a substitute
   [INFO]      [exec] ST4-4.3.4.jar: missing complete upstream LICENSE/COPYING; 
a POM name or link is not a substitute
   [INFO]      [exec] ... (164 components in total)
   [INFO]      [exec] Spring Boot loader: missing the original 
META-INF/LICENSE.txt or NOTICE.txt
   [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-antrun-plugin:3.2.0:run (binary-license-gate) on 
project rocketmq-studio: An Ant BuildException has occurred: exec returned: 1
   [INFO] BUILD FAILURE
   [INFO] Total time:  02:03 min
   ```
   
   Green — after the change, the same command in the default lifecycle:
   
   ```
   $ cd server && mvn -B -ntp clean package -DskipTests -Dlicense.python=python
   [INFO] You have 0 Checkstyle violations.
   [INFO] Building jar: ...\target\rocketmq-studio-3.0.0.jar
   [INFO] --- spring-boot:4.1.0:repackage (repackage) @ rocketmq-studio ---
   [INFO] Replacing main artifact ...\target\rocketmq-studio-3.0.0.jar with 
repackaged archive, adding nested dependencies in BOOT-INF/.
   [INFO] BUILD SUCCESS
   [INFO] Total time:  01:19 min
   ```
   
   Control — the gate is still there and still fails identically when the 
profile is enabled (`164` `missing complete upstream LICENSE/COPYING` lines, 
`exit=1`):
   
   ```
   $ cd server && mvn -B -ntp package -DskipTests -Pbinary-license-gate 
-Dlicense.python=python
   [INFO] --- antrun:3.2.0:run (binary-license-gate) @ rocketmq-studio ---
   [INFO]      [exec] license gate: release license gate failed:
   [INFO]      [exec] HikariCP-7.0.2.jar: missing complete upstream 
LICENSE/COPYING; a POM name or link is not a substitute
   [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-antrun-plugin:3.2.0:run (binary-license-gate) on 
project rocketmq-studio: An Ant BuildException has occurred: exec returned: 1
   ```
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits
   - [ ] Tests added or updated for non-trivial changes — not applicable: build 
wiring only, no Java, no behaviour of `legal.py`; verified by the three build 
runs above
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
— not applicable, no UI text
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks) — no Java source changed, and the `test` lifecycle never reached this 
execution (it is bound to `package`)
   - [x] New source files carry the ASF license header — no new source files
   - [x] Documentation touched where behaviour changed (README / `docs/` / 
in-app help) — not applicable: the profile and its command are documented in 
the `server/pom.xml` comment next to the profile
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to