This is an automated email from the ASF dual-hosted git repository.

suxiaogang223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 258c9991de8 [improvement](build) Optimize FE incremental build 
packaging (#62915)
258c9991de8 is described below

commit 258c9991de8131fcfdd64eb2c14479f903d84bae
Author: Socrates <[email protected]>
AuthorDate: Thu May 7 14:50:12 2026 +0800

    [improvement](build) Optimize FE incremental build packaging (#62915)
    
    ### 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 <!-- At least one of them must be included. -->
        - [ ] Regression test
        - [ ] Unit Test
        - [x] 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 <!-- Add your reason?  -->
    
    - Behavior changed:
        - [x] No.
        - [ ] Yes. <!-- Explain the behavior change -->
    
    - Does this need documentation?
        - [x] No.
    - [ ] Yes. <!-- Add document PR link here. eg:
    https://github.com/apache/doris-website/pull/1214 -->
    
    ### Check List (For Reviewer who merge this PR)
    
    - [ ] Confirm the release note
    - [ ] Confirm test cases
    - [ ] Confirm document
    - [ ] Add branch pick label <!-- Add branch pick label that this PR
    should merge into -->
---
 build.sh                                |  4 +-
 fe/.mvn/maven-build-cache-config.xml    | 18 ++------
 fe/fe-catalog/pom.xml                   | 42 ++++++++++--------
 fe/fe-common/pom.xml                    | 39 ++++++++++-------
 fe/fe-core/pom.xml                      | 50 +++++----------------
 fe/fe-core/src/main/assembly/fe-lib.xml | 36 +++++++++++++++
 fe/fe-foundation/pom.xml                | 41 +++++++++++-------
 fe/fe-grpc/pom.xml                      | 38 +++++++++-------
 fe/fe-thrift/pom.xml                    | 38 +++++++++-------
 fe/fe-type/pom.xml                      | 42 ++++++++++--------
 fe/hive-udf/pom.xml                     | 40 ++++++++++-------
 fe/pom.xml                              | 77 ++++++++++++++++++++-------------
 fs_brokers/cdc_client/build.sh          |  2 +-
 run-fe-ut.sh                            |  4 +-
 14 files changed, 267 insertions(+), 204 deletions(-)

diff --git a/build.sh b/build.sh
index 424a1717cfe..a5fe18b3e8d 100755
--- a/build.sh
+++ b/build.sh
@@ -816,7 +816,7 @@ function build_fe_modules() {
     local -a user_settings_opts=()
     local -a mvn_cmd=(
         "${MVN_CMD}"
-        install
+        package
         -pl
         "${FE_MODULES}"
         -am
@@ -892,7 +892,7 @@ if [[ "${BUILD_FE}" -eq 1 ]]; then
     cp -r -p "${DORIS_HOME}/conf/ldap.conf" "${DORIS_OUTPUT}/fe/conf"/
     cp -r -p "${DORIS_HOME}/conf/mysql_ssl_default_certificate" 
"${DORIS_OUTPUT}/fe/"/
     rm -rf "${DORIS_OUTPUT}/fe/lib"/*
-    cp -r -p "${DORIS_HOME}/fe/fe-core/target/lib"/* "${DORIS_OUTPUT}/fe/lib"/
+    unzip -q -o "${DORIS_HOME}/fe/fe-core/target/doris-fe-lib.zip" -d 
"${DORIS_OUTPUT}/fe/lib"
     cp -r -p "${DORIS_HOME}/fe/fe-core/target/doris-fe.jar" 
"${DORIS_OUTPUT}/fe/lib"/
     if [[ "${WITH_TDE_DIR}" != "" ]]; then
         cp -r -p 
"${DORIS_HOME}/fe/fe-${WITH_TDE_DIR}/target/fe-${WITH_TDE_DIR}-1.2-SNAPSHOT.jar"
 "${DORIS_OUTPUT}/fe/lib"/
diff --git a/fe/.mvn/maven-build-cache-config.xml 
b/fe/.mvn/maven-build-cache-config.xml
index b45cde165ca..59c73b6dafb 100644
--- a/fe/.mvn/maven-build-cache-config.xml
+++ b/fe/.mvn/maven-build-cache-config.xml
@@ -17,10 +17,10 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 -->
-<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0";
+<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.2.0";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-       xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0
-                           
https://maven.apache.org/xsd/build-cache-config-1.0.0.xsd";>
+       xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.2.0
+                           
https://maven.apache.org/xsd/build-cache-config-1.2.0.xsd";>
     <configuration>
         <enabled>true</enabled>
         <hashAlgorithm>XX</hashAlgorithm>
@@ -70,18 +70,6 @@ under the License.
                         <execId>validate</execId>
                     </execIds>
                 </execution>
-                <!-- dependency:copy-dependencies writes JARs to target/lib/ 
which the build
-                     scripts later copy into the output directory. The cache 
extension only
-                     restores the primary JAR artifact on a hit, not the 
target/lib/ tree.
-                     When combined with a clean build, target/lib/ is
-                     deleted by the clean phase and never recreated, causing 
"cp: cannot stat
-                     target/lib/*" failures. Force this goal to always run so 
that the lib
-                     directory is always populated regardless of cache state. 
-->
-                <execution artifactId="maven-dependency-plugin">
-                    <execIds>
-                        <execId>copy-dependencies</execId>
-                    </execIds>
-                </execution>
             </executions>
         </runAlways>
     </executionControl>
diff --git a/fe/fe-catalog/pom.xml b/fe/fe-catalog/pom.xml
index eb86585dc1a..74ca1a60fb4 100644
--- a/fe/fe-catalog/pom.xml
+++ b/fe/fe-catalog/pom.xml
@@ -91,23 +91,6 @@ under the License.
                     
<libDirectory>src/main/antlr4/org/apache/doris/parser</libDirectory>
                 </configuration>
             </plugin>
-            <!-- Build source jar -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-                <configuration>
-                    <attach>true</attach>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>create-source-jar</id>
-                        <goals>
-                            <goal>jar-no-fork</goal>
-                            <goal>test-jar-no-fork</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <!-- Build test-jar for projects that may depend on test utilities 
-->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -131,4 +114,29 @@ under the License.
             </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <configuration>
+                            <attach>true</attach>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>create-source-jar</id>
+                                <goals>
+                                    <goal>jar-no-fork</goal>
+                                    <goal>test-jar-no-fork</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
diff --git a/fe/fe-common/pom.xml b/fe/fe-common/pom.xml
index 8c2282d418c..3452c3e5967 100644
--- a/fe/fe-common/pom.xml
+++ b/fe/fe-common/pom.xml
@@ -42,6 +42,29 @@ under the License.
                 <doris.thirdparty>${env.DORIS_THIRDPARTY}</doris.thirdparty>
             </properties>
         </profile>
+        <profile>
+            <id>release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <configuration>
+                            <attach>true</attach>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>create-source-jar</id>
+                                <goals>
+                                    <goal>jar-no-fork</goal>
+                                    <goal>test-jar-no-fork</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
     <dependencies>
         <dependency>
@@ -202,22 +225,6 @@ under the License.
                     
<libDirectory>src/main/antlr4/org/apache/doris/parser</libDirectory>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-                <configuration>
-                    <attach>true</attach>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>create-source-jar</id>
-                        <goals>
-                            <goal>jar-no-fork</goal>
-                            <goal>test-jar-no-fork</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <!-- Build test-jar's for all projects, since some projects depend 
on tests from others -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
diff --git a/fe/fe-core/pom.xml b/fe/fe-core/pom.xml
index 1ee621fd7dd..6e6ec0969b5 100644
--- a/fe/fe-core/pom.xml
+++ b/fe/fe-core/pom.xml
@@ -930,25 +930,24 @@ under the License.
                     </execution>
                 </executions>
             </plugin>
-            <!-- copy all dependency libs to target lib dir -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <appendAssemblyId>true</appendAssemblyId>
+                    
<outputDirectory>${project.build.directory}</outputDirectory>
+                    <recompressZippedFiles>false</recompressZippedFiles>
+                    <descriptors>
+                        <descriptor>src/main/assembly/fe-lib.xml</descriptor>
+                    </descriptors>
+                </configuration>
                 <executions>
                     <execution>
-                        <id>copy-dependencies</id>
+                        <id>make-fe-lib</id>
                         <phase>package</phase>
                         <goals>
-                            <goal>copy-dependencies</goal>
+                            <goal>single</goal>
                         </goals>
-                        <configuration>
-                            
<outputDirectory>${project.build.directory}/lib</outputDirectory>
-                            <overWriteReleases>false</overWriteReleases>
-                            <overWriteSnapshots>false</overWriteSnapshots>
-                            <overWriteIfNewer>true</overWriteIfNewer>
-                            <includeScope>runtime</includeScope>
-                            <skip>${skip.plugin}</skip>
-                        </configuration>
                     </execution>
                 </executions>
             </plugin>
@@ -962,33 +961,6 @@ under the License.
                     </check>
                 </configuration>
             </plugin>
-            <!-- clean fe/target dir before building -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-clean-plugin</artifactId>
-                <version>3.1.0</version>
-                <configuration>
-                    <skip>${skip.clean}</skip>
-                    <excludeDefaultDirectories>true</excludeDefaultDirectories>
-                    <filesets>
-                        <fileset>
-                            <directory>target</directory>
-                            <excludes>
-                                <exclude>checkstyle-cachefile</exclude>
-                            </excludes>
-                        </fileset>
-                    </filesets>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>auto-clean</id>
-                        <phase>initialize</phase>
-                        <goals>
-                            <goal>clean</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
         <extensions>
             <extension>
diff --git a/fe/fe-core/src/main/assembly/fe-lib.xml 
b/fe/fe-core/src/main/assembly/fe-lib.xml
new file mode 100644
index 00000000000..34729238064
--- /dev/null
+++ b/fe/fe-core/src/main/assembly/fe-lib.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0";
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 
https://maven.apache.org/xsd/assembly-2.2.0.xsd";>
+    <id>lib</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <dependencySets>
+        <dependencySet>
+            <outputDirectory>/</outputDirectory>
+            <scope>runtime</scope>
+            <useProjectArtifact>false</useProjectArtifact>
+            <unpack>false</unpack>
+        </dependencySet>
+    </dependencySets>
+</assembly>
diff --git a/fe/fe-foundation/pom.xml b/fe/fe-foundation/pom.xml
index 5486bf56c25..6565fd20d08 100644
--- a/fe/fe-foundation/pom.xml
+++ b/fe/fe-foundation/pom.xml
@@ -47,22 +47,6 @@ under the License.
         <finalName>doris-fe-foundation</finalName>
         <directory>${project.basedir}/target/</directory>
         <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-                <configuration>
-                    <attach>true</attach>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>create-source-jar</id>
-                        <goals>
-                            <goal>jar-no-fork</goal>
-                            <goal>test-jar-no-fork</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-jar-plugin</artifactId>
@@ -85,4 +69,29 @@ under the License.
             </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <configuration>
+                            <attach>true</attach>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>create-source-jar</id>
+                                <goals>
+                                    <goal>jar-no-fork</goal>
+                                    <goal>test-jar-no-fork</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
diff --git a/fe/fe-grpc/pom.xml b/fe/fe-grpc/pom.xml
index f873b28d074..ef5c8b66847 100644
--- a/fe/fe-grpc/pom.xml
+++ b/fe/fe-grpc/pom.xml
@@ -59,6 +59,28 @@ under the License.
                 
<grpc.java.artifact>io.grpc:protoc-gen-grpc-java:${grpc-java.version}:exe:osx-x86_64</grpc.java.artifact>
             </properties>
         </profile>
+        <profile>
+            <id>release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <configuration>
+                            <attach>true</attach>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>create-source-jar</id>
+                                <goals>
+                                    <goal>jar-no-fork</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
 
     <dependencies>
@@ -89,22 +111,6 @@ under the License.
         <finalName>doris-fe-grpc</finalName>
         <directory>${project.basedir}/target/</directory>
         <plugins>
-            <!-- Build source jar -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-                <configuration>
-                    <attach>true</attach>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>create-source-jar</id>
-                        <goals>
-                            <goal>jar-no-fork</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <!-- protobuf -->
             <plugin>
                 <groupId>com.github.os72</groupId>
diff --git a/fe/fe-thrift/pom.xml b/fe/fe-thrift/pom.xml
index c94bb94127c..19bdde55edb 100644
--- a/fe/fe-thrift/pom.xml
+++ b/fe/fe-thrift/pom.xml
@@ -42,6 +42,28 @@ under the License.
                 
<doris.thrift.executable>${env.DORIS_THIRDPARTY}/installed/bin/thrift</doris.thrift.executable>
             </properties>
         </profile>
+        <profile>
+            <id>release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <configuration>
+                            <attach>true</attach>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>create-source-jar</id>
+                                <goals>
+                                    <goal>jar-no-fork</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
     <artifactId>fe-thrift</artifactId>
     <packaging>jar</packaging>
@@ -60,22 +82,6 @@ under the License.
         <finalName>doris-fe-thrift</finalName>
         <directory>${project.basedir}/target/</directory>
         <plugins>
-            <!-- Build source jar -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-                <configuration>
-                    <attach>true</attach>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>create-source-jar</id>
-                        <goals>
-                            <goal>jar-no-fork</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
                 <groupId>org.apache.thrift</groupId>
                 <artifactId>thrift-maven-plugin</artifactId>
diff --git a/fe/fe-type/pom.xml b/fe/fe-type/pom.xml
index a4ad19e2a3e..bfd6fe3683e 100644
--- a/fe/fe-type/pom.xml
+++ b/fe/fe-type/pom.xml
@@ -66,23 +66,6 @@ under the License.
         <finalName>doris-fe-type</finalName>
         <directory>${project.basedir}/target/</directory>
         <plugins>
-            <!-- Build source jar -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-                <configuration>
-                    <attach>true</attach>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>create-source-jar</id>
-                        <goals>
-                            <goal>jar-no-fork</goal>
-                            <goal>test-jar-no-fork</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <!-- Build test-jar for projects that may depend on test utilities 
-->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -106,4 +89,29 @@ under the License.
             </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <configuration>
+                            <attach>true</attach>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>create-source-jar</id>
+                                <goals>
+                                    <goal>jar-no-fork</goal>
+                                    <goal>test-jar-no-fork</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
diff --git a/fe/hive-udf/pom.xml b/fe/hive-udf/pom.xml
index dd7e17797af..a69d77abf7d 100644
--- a/fe/hive-udf/pom.xml
+++ b/fe/hive-udf/pom.xml
@@ -86,22 +86,6 @@ under the License.
         <finalName>hive-udf</finalName>
         <directory>${project.basedir}/target/</directory>
         <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-                <configuration>
-                    <attach>true</attach>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>create-source-jar</id>
-                        <goals>
-                            <goal>jar-no-fork</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
@@ -151,4 +135,28 @@ under the License.
             </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <configuration>
+                            <attach>true</attach>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>create-source-jar</id>
+                                <goals>
+                                    <goal>jar-no-fork</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
diff --git a/fe/pom.xml b/fe/pom.xml
index 487d10ef9ec..280d348405f 100644
--- a/fe/pom.xml
+++ b/fe/pom.xml
@@ -84,11 +84,6 @@ under the License.
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>flatten-maven-plugin</artifactId>
-                <version>1.2.5</version>
-            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
@@ -118,32 +113,6 @@ under the License.
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-checkstyle-plugin</artifactId>
             </plugin>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>license-maven-plugin</artifactId>
-                <version>2.1.0</version>
-                <executions>
-                    <execution>
-                        <id>add-third-party</id>
-                        <goals>
-                            <goal>add-third-party</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.jacoco</groupId>
-                <artifactId>jacoco-maven-plugin</artifactId>
-                <version>${jacoco.version}</version>
-                <executions>
-                    <execution>
-                        <id>default-prepare-agent</id>
-                        <goals>
-                            <goal>prepare-agent</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
         <pluginManagement>
             <plugins>
@@ -470,6 +439,52 @@ under the License.
                 </pluginRepository>
             </pluginRepositories>
         </profile>
+        <profile>
+            <id>flatten</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>flatten-maven-plugin</artifactId>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>license-maven-plugin</artifactId>
+                        <version>2.1.0</version>
+                        <executions>
+                            <execution>
+                                <id>add-third-party</id>
+                                <goals>
+                                    <goal>add-third-party</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>coverage</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.jacoco</groupId>
+                        <artifactId>jacoco-maven-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
     <dependencyManagement>
         <dependencies>
diff --git a/fs_brokers/cdc_client/build.sh b/fs_brokers/cdc_client/build.sh
index e3d984f5a92..5ad59caac24 100755
--- a/fs_brokers/cdc_client/build.sh
+++ b/fs_brokers/cdc_client/build.sh
@@ -27,7 +27,7 @@ export CDC_CLIENT_HOME="${ROOT}"
 
 "${DORIS_HOME}"/generated-source.sh noclean
 cd "${DORIS_HOME}/fe"
-"${MVN_CMD}" install -pl fe-common -Dskip.doc=true -DskipTests 
-Dmaven.build.cache.enabled=false
+"${MVN_CMD}" -Pflatten install -pl fe-common -Dskip.doc=true -DskipTests 
-Dmaven.build.cache.enabled=false
 
 echo "Install cdc client..."
 cd "${CDC_CLIENT_HOME}"
diff --git a/run-fe-ut.sh b/run-fe-ut.sh
index 359e3be2a30..35d470753c3 100755
--- a/run-fe-ut.sh
+++ b/run-fe-ut.sh
@@ -114,14 +114,14 @@ if [[ "${RUN}" -eq 1 ]]; then
     # sh run-fe-ut.sh --run 
org.apache.doris.utframe.DemoTest#testCreateDbAndTable+test2
 
     if [[ "${COVERAGE}" -eq 1 ]]; then
-        "${MVN_CMD}" test jacoco:report -DfailIfNoTests=false -Dtest="$1"
+        "${MVN_CMD}" -Pcoverage test jacoco:report -DfailIfNoTests=false 
-Dtest="$1"
     else
         "${MVN_CMD}" test -Dcheckstyle.skip=true -DfailIfNoTests=false 
-Dmaven.build.cache.enabled=false -Dtest="$1"
     fi
 else
     echo "Run Frontend UT"
     if [[ "${COVERAGE}" -eq 1 ]]; then
-        "${MVN_CMD}" test jacoco:report -DfailIfNoTests=false 
-Dmaven.test.failure.ignore=true
+        "${MVN_CMD}" -Pcoverage test jacoco:report -DfailIfNoTests=false 
-Dmaven.test.failure.ignore=true
     else
         "${MVN_CMD}" test -Dcheckstyle.skip=true -DfailIfNoTests=false 
-Dmaven.build.cache.enabled=false
     fi


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to