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

chengpan pushed a commit to branch branch-1.9
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/branch-1.9 by this push:
     new 549761720 [KYUUBI #6416] Generate flattened POM
549761720 is described below

commit 549761720d7f2ecab43ee2798a00c09fcf4368c1
Author: Cheng Pan <[email protected]>
AuthorDate: Fri May 24 18:20:25 2024 +0800

    [KYUUBI #6416] Generate flattened POM
    
    # :mag: Description
    
    Leverage [Flatten Maven 
Plugin](https://www.mojohaus.org/flatten-maven-plugin/) to generate resolved 
`pom.xml`.
    
    This recovers a dev case for Scala 2.13.
    
    We usually perform `clean install` with `-am` and `-DskipTests` one time 
and perform `test` after changing code on specific modules, e.g.
    ```
    build/mvn -Pscala-2.13 -pl externals/kyuubi-spark-sql-engine clean install 
-am -DskipTests
    build/mvn -Pscala-2.13 -pl externals/kyuubi-spark-sql-engine test
    ```
    
    Currently, the second step wrongly resolves to `*_2.12` dependencies due to 
the installed `pom.xml` referring to `*_${scala.binary.version}` while the 
default value of `scala.binary.version` is `2.12`.
    
    ## Types of changes :bookmark:
    
    - [x] Bugfix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
    
    ## Test Plan ๐Ÿงช
    
    This change is verified locally by the above case.
    
    ---
    
    # Checklist ๐Ÿ“
    
    - [x] This patch was not authored or co-authored using [Generative 
Tooling](https://www.apache.org/legal/generative-tooling.html)
    
    **Be nice. Be informative.**
    
    Closes #6416 from pan3793/flatten.
    
    Closes #6416
    
    db7020c92 [Cheng Pan] Generate flattened pom.xml
    
    Authored-by: Cheng Pan <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
    (cherry picked from commit 4702f5a12bc4fb847e704c66c869341c41f9ce18)
    Signed-off-by: Cheng Pan <[email protected]>
---
 .gitignore |  1 +
 pom.xml    | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/.gitignore b/.gitignore
index b1bf7dc2a..29bb61545 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,6 +58,7 @@ spark-warehouse/
 metastore_db
 derby.log
 rest-audit.log
+**/.flattened-pom.xml
 **/dependency-reduced-pom.xml
 metrics/
 /kyuubi-ha/embedded_zookeeper/
diff --git a/pom.xml b/pom.xml
index 4c4e0fc58..9f256725a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -226,6 +226,7 @@
         <maven.plugin.download.version>1.8.1</maven.plugin.download.version>
         <maven.plugin.download.cache.path></maven.plugin.download.cache.path>
         
<maven.plugin.enforcer.mojo.rules.version>1.6.1</maven.plugin.enforcer.mojo.rules.version>
+        <maven.plugin.flatten.version>1.6.0</maven.plugin.flatten.version>
         <maven.plugin.frontend.version>1.12.1</maven.plugin.frontend.version>
         <maven.plugin.scala.version>4.8.0</maven.plugin.scala.version>
         <maven.plugin.scalatest.version>2.2.0</maven.plugin.scalatest.version>
@@ -1491,6 +1492,21 @@
                     <version>${maven.plugin.shade.version}</version>
                 </plugin>
 
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>flatten-maven-plugin</artifactId>
+                    <version>${maven.plugin.flatten.version}</version>
+                    <executions>
+                        <execution>
+                            <id>flatten</id>
+                            <goals>
+                                <goal>flatten</goal>
+                            </goals>
+                            <phase>process-resources</phase>
+                        </execution>
+                    </executions>
+                </plugin>
+
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-dependency-plugin</artifactId>
@@ -1731,6 +1747,11 @@
         </pluginManagement>
 
         <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>flatten-maven-plugin</artifactId>
+            </plugin>
+
             <!-- dump test classpath into a folder -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>

Reply via email to