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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4b115ab821 [fix][COM][dist] Fix Spring Boot 2.7 deployment 
compatibility and transitive dependency issues (#5447)
4b115ab821 is described below

commit 4b115ab8213a7b1522a7ec449e048ee768fc2a8e
Author: aiceflower <[email protected]>
AuthorDate: Thu Jun 25 15:04:02 2026 +0800

    [fix][COM][dist] Fix Spring Boot 2.7 deployment compatibility and 
transitive dependency issues (#5447)
    
    * fix: 修复 snakeyaml 被错误排除导致服务启动失败
    
    问题: linkis-module 和 linkis-eureka 的 pom.xml 中排除了 snakeyaml,
    导致 Spring Boot 无法解析 application-eureka.yml 和 application-linkis.yml,
    所有服务启动失败。
    
    修复: 在两个模块中添加 snakeyaml 为显式 compile 依赖,覆盖排除策略。
    
    关联部署问题: jackson-module-scala 和 hadoop-hdfs 版本问题由增量构建时
    profile 混用导致,-Papache profile 配置正确,干净编译即可解决。
    
    Co-Authored-By: Claude Opus 4.7 <[email protected]>
    
    * fix: 排除错误的传递依赖 jackson-module-scala_2.11 和 hadoop-hdfs-2.7.2
    
    问题: Maven 传递依赖解析时,scala.binary.version property 在 linkis-common
    的依赖声明中未正确传递到 linkis-dist,导致 jackson-module-scala_2.11 (应为 2.12)
    和 hadoop-hdfs:2.7.2 (应为 hadoop-hdfs-client:3.3.4) 被错误打包。
    
    修复: 在 linkis-dist/pom.xml 中显式排除这两个错误版本并引入正确版本。
    
    Co-Authored-By: Claude Opus 4.7 <[email protected]>
    
    * #AI COMMIT# fix: 补全 Spring Boot 2.7 部署兼容性配置
    
    - linkis-dist/pom.xml: 显式引入 commons-lang 2.6 (Eureka Client 依赖其
      ExceptionUtils, 但 spring-cloud-netflix 传递依赖未带入)
    - application-engineconn.yml: 补全 spring.main.allow-circular-references +
      spring.mvc.pathmatch.matching-strategy (ant_path_matcher) +
      spring.mvc.servlet.path + spring.cloud.loadbalancer.cache.enabled=false
    
      eureka.yml 和 linkis.yml 已在 master 上含相关配置,但 engineconn.yml
      遗漏了。缺失会导致 RPC POST /rpc/receiveAndReply 返回 404,引擎启动失败。
    
    Co-Authored-By: Claude Opus 4.7 <[email protected]>
    
    * #AI COMMIT# fix: 修复 impala 引擎编译失败 (slf4j-api 缺失)
    
    impala 模块编译报错 "Symbol 'type org.slf4j.Logger' is missing from the
    classpath",根因是 slf4j-api 不在 impala 编译 classpath 中:
    
    - linkis-common 标记为 <scope>provided</scope>,不传递 slf4j-api
    - impala-frontend / impala-minimal-hive-exec 用 <exclusions>*</exclusions>
      排除所有传递依赖,slf4j-api 也被一并排除
    
    Logging.logger 和 Utils.tryAndWarn 隐式参数都依赖 org.slf4j.Logger,
    必须显式引入 slf4j-api 才能编译通过。
    
    Co-Authored-By: Claude Opus 4.7 <[email protected]>
    
    ---------
    
    Co-authored-by: Claude Opus 4.7 <[email protected]>
---
 linkis-commons/linkis-module/pom.xml                    |  5 +++++
 linkis-dist/package/conf/application-engineconn.yml     | 13 +++++++++++++
 linkis-dist/pom.xml                                     | 17 +++++++++++++++++
 linkis-dist/src/main/assembly/distribution.xml          |  2 ++
 linkis-engineconn-plugins/impala/pom.xml                |  8 ++++++++
 .../linkis-service-discovery/linkis-eureka/pom.xml      |  9 +++++----
 6 files changed, 50 insertions(+), 4 deletions(-)

diff --git a/linkis-commons/linkis-module/pom.xml 
b/linkis-commons/linkis-module/pom.xml
index 687cc88460..00ee41d384 100644
--- a/linkis-commons/linkis-module/pom.xml
+++ b/linkis-commons/linkis-module/pom.xml
@@ -360,6 +360,11 @@
       <artifactId>spring-retry</artifactId>
       <version>1.3.4</version>
     </dependency>
+    <dependency>
+      <groupId>org.yaml</groupId>
+      <artifactId>snakeyaml</artifactId>
+      <version>${snakeyaml.version}</version>
+    </dependency>
   </dependencies>
 
   <build>
diff --git a/linkis-dist/package/conf/application-engineconn.yml 
b/linkis-dist/package/conf/application-engineconn.yml
index 4f9610513c..bf13af55b8 100644
--- a/linkis-dist/package/conf/application-engineconn.yml
+++ b/linkis-dist/package/conf/application-engineconn.yml
@@ -15,11 +15,24 @@
 spring:
   application:
     name: linkis-cg-engineconn
+  main:
+    allow-bean-definition-overriding: true
+    # Spring Boot 2.7+ compatibility: required for springfox 3.0.0 + Linkis 
internal bean cycles
+    allow-circular-references: true
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
+    servlet:
+      path: /api/rest_j/v1
   servlet:
     multipart:
       max-file-size: 500MB
       max-request-size: 500MB
       file-size-threshold: 50MB
+  cloud:
+    loadbalancer:
+      cache:
+        enabled: false
 eureka:
   instance:
     # prefer-ip-address: true
diff --git a/linkis-dist/pom.xml b/linkis-dist/pom.xml
index dbc115f829..5ffb17e07a 100644
--- a/linkis-dist/pom.xml
+++ b/linkis-dist/pom.xml
@@ -158,6 +158,23 @@
       <artifactId>commons-beanutils</artifactId>
     </dependency>
 
+    <!-- 显式引入正确的 scala/hadoop 依赖,覆盖传递依赖中的错误版本 -->
+    <dependency>
+      <groupId>com.fasterxml.jackson.module</groupId>
+      <artifactId>jackson-module-scala_2.12</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-hdfs-client</artifactId>
+      <version>${hadoop.version}</version>
+    </dependency>
+    <!-- Eureka Client 依赖 commons-lang 2.x 的 ExceptionUtils -->
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.6</version>
+    </dependency>
+
   </dependencies>
 
   <build>
diff --git a/linkis-dist/src/main/assembly/distribution.xml 
b/linkis-dist/src/main/assembly/distribution.xml
index c1f876896a..0bc2d1dfd8 100644
--- a/linkis-dist/src/main/assembly/distribution.xml
+++ b/linkis-dist/src/main/assembly/distribution.xml
@@ -301,6 +301,8 @@
             <useStrictFiltering>false</useStrictFiltering>
             <useTransitiveFiltering>true</useTransitiveFiltering>
             <excludes>
+                
<exclude>com.fasterxml.jackson.module:jackson-module-scala_2.11:*</exclude>
+                <exclude>org.apache.hadoop:hadoop-hdfs:*</exclude>
             </excludes>
         </dependencySet>
     </dependencySets>
diff --git a/linkis-engineconn-plugins/impala/pom.xml 
b/linkis-engineconn-plugins/impala/pom.xml
index 87f8ec8acc..bc24c5c760 100644
--- a/linkis-engineconn-plugins/impala/pom.xml
+++ b/linkis-engineconn-plugins/impala/pom.xml
@@ -70,6 +70,14 @@
       <version>${libthrift.version}</version>
     </dependency>
 
+    <!-- slf4j-api must be declared explicitly because both linkis-common 
(provided) and
+         impala-* artifacts (all transitive deps excluded) do not bring it in.
+         Required by Logging.logger and Utils.tryAndWarn implicit parameter. 
-->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+
     <!-- impala -->
     <dependency>
       <groupId>org.apache.impala</groupId>
diff --git 
a/linkis-spring-cloud-services/linkis-service-discovery/linkis-eureka/pom.xml 
b/linkis-spring-cloud-services/linkis-service-discovery/linkis-eureka/pom.xml
index 33254add42..a1f2a97b5b 100644
--- 
a/linkis-spring-cloud-services/linkis-service-discovery/linkis-eureka/pom.xml
+++ 
b/linkis-spring-cloud-services/linkis-service-discovery/linkis-eureka/pom.xml
@@ -78,12 +78,13 @@
           <groupId>org.springframework.boot</groupId>
           <artifactId>spring-boot-starter-logging</artifactId>
         </exclusion>
-        <exclusion>
-          <groupId>org.yaml</groupId>
-          <artifactId>snakeyaml</artifactId>
-        </exclusion>
       </exclusions>
     </dependency>
+    <dependency>
+      <groupId>org.yaml</groupId>
+      <artifactId>snakeyaml</artifactId>
+      <version>${snakeyaml.version}</version>
+    </dependency>
     <dependency>
       <groupId>io.micrometer</groupId>
       <artifactId>micrometer-registry-prometheus</artifactId>


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

Reply via email to