Skip to content

[improvement](build) Optimize FE incremental build packaging#62915

Merged
suxiaogang223 merged 10 commits into
apache:masterfrom
suxiaogang223:codex/fe-build-optimization-doc
May 7, 2026
Merged

[improvement](build) Optimize FE incremental build packaging#62915
suxiaogang223 merged 10 commits into
apache:masterfrom
suxiaogang223:codex/fe-build-optimization-doc

Conversation

@suxiaogang223
Copy link
Copy Markdown
Member

@suxiaogang223 suxiaogang223 commented Apr 28, 2026

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:
This PR optimizes the Doris FE build path so ordinary ./build.sh --fe builds no longer clear fe-core/target or rebuild runtime dependency directories as a side effect.

The main changes are:

  • Remove the default maven-clean-plugin:auto-clean execution from fe-core, so Maven can reuse target/classes for incremental compilation.
  • Replace maven-dependency-plugin:copy-dependencies with maven-assembly-plugin and produce fe/fe-core/target/doris-fe-lib.zip as a Maven package artifact.
  • Disable recompression of already-compressed runtime dependency jars in the FE lib assembly to reduce Maven assembly heap pressure.
  • Update build.sh --fe to run Maven package instead of install, then unpack doris-fe-lib.zip into output/fe/lib.
  • Keep run-fe-ut.sh --coverage aligned with the new explicit coverage profile so normal FE UTs do not enable JaCoCo, while coverage runs still attach the JaCoCo agent and generate reports.
  • Remove the build-cache copy-dependencies runAlways workaround and align the build-cache config schema with the 1.2.0 schema shipped by maven-build-cache-extension:1.2.2.
  • Move non-daily build tasks into explicit profiles: release-only license/flatten/source artifacts and coverage-only Jacoco setup.
  • Keep source artifact generation scoped to the modules that already generated source artifacts before this change.
  • Keep standalone CDC client builds working by installing a flattened fe-common POM before cdc_client resolves it outside the FE reactor.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
      • mvn -q -Prelease help:effective-pom -Doutput=/tmp/doris-fe-release-effective-pom.xml -DskipTests -Dcheckstyle.skip=true -Dskip.doc=true
      • mvn -q -f fe/pom.xml help:effective-pom -Doutput=/tmp/doris-fe-effective-pom-schema-1.2.0.xml -DskipTests -Dcheckstyle.skip=true -Dskip.doc=true
      • MAVEN_OPTS="-Xmx8g" DISABLE_BUILD_UI=ON ./build.sh --fe
      • DISABLE_BUILD_UI=ON ./build.sh --fe
      • ./run-fe-ut.sh --coverage --run org.apache.doris.common.PatternMatcherTest
      • ./fs_brokers/cdc_client/build.sh
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Document the final Maven-based FE build optimization shape, including reproducible runtime lib packaging, build-cache handling, build.sh behavior, and validation requirements.

### Release note

None

### Check List (For Author)

- Test: No need to test (documentation-only change)
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Avoid cleaning fe-core target on every FE build and replace copy-dependencies with a cacheable assembly archive for FE runtime libraries. Move non-daily Maven actions to explicit profiles.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - DISABLE_BUILD_UI=ON DISABLE_JAVA_CHECK_STYLE=ON DISABLE_BE_JAVA_EXTENSIONS=ON DISABLE_BUILD_HIVE_UDF=ON ./build.sh --fe
    - mvn -f fe/pom.xml package -pl fe-core -am -DskipTests -Dcheckstyle.skip=true
    - Deleted fe-core target jar and runtime lib zip, then verified Maven build cache 1.2.2 restores both artifacts.
    - Compared fe-core runtime lib zip jar list with output/fe/lib third-party jar list.
    - mvn -f fe/pom.xml package -pl fe-thrift -am -Prelease -DskipTests -Dcheckstyle.skip=true
- Behavior changed: No
- Does this need documentation: Yes (updated docs/dev/fe-build-optimization.md)
### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: Align the FE build optimization design document with the current branch implementation, including the assembly zip packaging flow, build cache behavior, profile moves, and retained test-jar bindings.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - Ran git diff --check for docs/dev/fe-build-optimization.md
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: Build FE output artifacts with Maven package instead of install so build.sh --fe only produces reactor target artifacts needed for output/fe and avoids writing local Maven repository artifacts during normal local builds.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - DISABLE_BUILD_UI=ON ./build.sh --fe
    - git diff --check -- build.sh docs/dev/fe-build-optimization.md
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: Keep source jar generation out of normal FE builds while preserving the pre-existing release artifact scope. The release profile no longer binds maven-source-plugin at the FE parent level; only modules that previously generated source artifacts keep module-local release bindings.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - mvn -q -Prelease help:effective-pom -Doutput=/tmp/doris-fe-release-effective-pom.xml -DskipTests -Dcheckstyle.skip=true -Dskip.doc=true
    - DISABLE_BUILD_UI=ON ./build.sh --fe
    - git diff --check -- modified files
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: Align FE maven-build-cache configuration namespace and XSD with the 1.2.0 schema shipped by maven-build-cache-extension 1.2.2.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - mvn -q -f fe/pom.xml help:effective-pom -Doutput=/tmp/doris-fe-effective-pom-schema-1.2.0.xml -DskipTests -Dcheckstyle.skip=true -Dskip.doc=true
    - DISABLE_BUILD_UI=ON ./build.sh --fe
    - git diff --check -- fe/.mvn/maven-build-cache-config.xml
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: Remove the FE build optimization plan document after its implementation checklist has been completed in code.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - Verified the implementation checklist against current code
    - Confirmed no remaining references to docs/dev/fe-build-optimization.md
    - git diff --check -- docs/dev/fe-build-optimization.md
- Behavior changed: No
- Does this need documentation: No
@suxiaogang223 suxiaogang223 marked this pull request as ready for review April 28, 2026 13:18
### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: Disable recompression of already-compressed runtime dependency jars when building the FE runtime lib assembly. This reduces Maven assembly heap pressure during build.sh --fe while preserving the unpacked output/fe/lib contents.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - DISABLE_BUILD_UI=ON ./build.sh --fe
    - git diff --check -- fe/fe-core/pom.xml
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: Update run-fe-ut.sh coverage commands to activate the coverage profile after JaCoCo configuration was moved out of default FE builds. This keeps normal FE unit test builds free of JaCoCo while preserving coverage report generation when --coverage is requested.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - ./run-fe-ut.sh --coverage --run org.apache.doris.common.PatternMatcherTest
    - git diff --check -- run-fe-ut.sh
- Behavior changed: No
- Does this need documentation: No
@suxiaogang223
Copy link
Copy Markdown
Member Author

run buildall

### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: Ensure the standalone CDC client build installs a flattened fe-common POM before resolving it outside the FE reactor. This prevents Maven from seeing an unresolved ${revision} parent version after flatten was moved out of the default FE build path.

### Release note

None

### Check List (For Author)

- Test: Manual test
    - ./fs_brokers/cdc_client/build.sh
    - git diff --check -- fe/pom.xml fs_brokers/cdc_client/build.sh
- Behavior changed: No
- Does this need documentation: No
@suxiaogang223
Copy link
Copy Markdown
Member Author

run buildall

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

PR approved by anyone and no changes requested.

@suxiaogang223 suxiaogang223 merged commit 258c999 into apache:master May 7, 2026
31 of 33 checks passed
@suxiaogang223 suxiaogang223 deleted the codex/fe-build-optimization-doc branch May 7, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants