Skip to content

fix(docker): skip repo-root Maven plugins and honor LEGAL_GATE in server build stage - #7426

Open
majialoong wants to merge 1 commit into
apache:masterfrom
majialoong:fix-docker-build-skip-repo-root-plugins
Open

majialoong wants to merge 1 commit into
apache:masterfrom
majialoong:fix-docker-build-skip-repo-root-plugins

Conversation

@majialoong

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Brief Description

In server/Dockerfile's build stage, pom.xml lives at /app (${project.basedir}/.. resolves to /), causing mvn package to run repo-root plugins against / and break Docker builds; meanwhile --build-arg LEGAL_GATE=0 was not honored in the build stage.

  • Skip apache-rat-plugin and maven-assembly-plugin (-Drat.skip=true -Dassembly.skipAssembly=true) in the build stage, matching deploy/deploy.sh.
  • Declare ARG LEGAL_GATE=1 in the build stage and pass -Dmaven.antrun.skip=true when LEGAL_GATE != 1 to stay in sync with the runtime check-jar gate.
  • Update server/scripts/legal_test.py to verify the mvn arguments under both LEGAL_GATE=1 and LEGAL_GATE=0.

How Did You Test This Change?

$ python3 -m unittest discover -s server/scripts -p '*_test.py'
Ran 15 tests in 0.084s

OK

Checklist

  • One coherent change; unrelated modifications are not bundled in
  • Commit subject follows Conventional Commits (feat: / fix: / refactor: / chore: / docs: / perf:)
  • Tests added or updated for non-trivial changes, test methods named ...Test
  • New UI text has both Chinese and English entries under web/src/i18n/ (N/A)
  • Architecture constraints stay green (mvn test runs the ArchUnit checks) (N/A — no Java changes)
  • New source files carry the ASF license header (no new files added)
  • Documentation touched where behaviour changed (README / docs/ / in-app help) (N/A)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Docker server build stage fails on repo-root Maven plugins and ignores LEGAL_GATE

1 participant