xuxiaowei-com-cn commented on code in PR #8030:
URL: https://github.com/apache/incubator-seata/pull/8030#discussion_r3016750658


##########
seata-spring-boot-starter/pom.xml:
##########
@@ -36,6 +36,10 @@
     </properties>
 
     <dependencies>
+        <dependency>
+            <groupId>com.fasterxml.jackson.datatype</groupId>
+            <artifactId>jackson-datatype-jsr310</artifactId>

Review Comment:
   # English
   
   I don't think so.
   
   1. According to 
https://github.com/apache/incubator-seata/blob/v2.6.0/rm-datasource/pom.xml#L73-L76,
 in seata 2.6.0, `org.apache.seata:seata-rm-datasource` already includes 
`com.fasterxml.jackson.datatype:jackson-datatype-jsr310`, but it does not take 
effect. The reason is in point 2.
   2. `org.apache.seata:seata-spring-boot-starter` introduces 
`org.apache.seata:seata-all`, and `org.apache.seata:seata-all` introduces 
`org.apache.seata:seata-rm-datasource`. However, `org.apache.seata:seata-all` 
uses the plugin `org.apache.maven.plugins:maven-shade-plugin`, which 
consolidates all introduced `org.apache.seata:*` and `io.seata:*` dependencies 
into a single JAR. Evidence is as follows:
       1. https://github.com/apache/incubator-seata/tree/v2.6.0/all does not 
contain any Java code.
       2. However, the packaged `org.apache.seata:seata-all:2.6.0:jar` from 
https://github.com/apache/incubator-seata/tree/v2.6.0/all does contain Java 
code.
           <img width="1764" height="1024" alt="image" 
src="https://github.com/user-attachments/assets/81bee311-75f4-4f83-85f5-1803364befce";
 />
   3. If you are not familiar with 
`org.apache.maven.plugins:maven-shade-plugin`, you can use the command `mvn 
dependency:tree -pl 
spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-seata -am > 
tree.txt` to analyze the latest code of the 2025.1.x branch from 
https://github.com/alibaba/spring-cloud-alibaba/ 
(https://github.com/alibaba/spring-cloud-alibaba/tree/0905316f2a3beb7fa9531871cb7ab64755bd46f8).
 You will see that only four `org.apache.seata:*` dependencies exist: 
`org.apache.seata:seata-spring-boot-starter:jar:2.6.0:compile`, 
`org.apache.seata:seata-spring-autoconfigure-client:jar:2.6.0:compile`, 
`org.apache.seata:seata-spring-autoconfigure-core:jar:2.6.0:compile`, and 
`org.apache.seata:seata-all:jar:2.6.0:compile`. It does not include 
`org.apache.seata:seata-rm-datasource`, and the reason is in point 2.
       [tree.txt](https://github.com/user-attachments/files/26382912/tree.txt)
   
   # 中文
   
   我不这样认为。
   
   1. 根据 
https://github.com/apache/incubator-seata/blob/v2.6.0/rm-datasource/pom.xml#L73-L76
 可知,在 seata 2.6.0 中,`org.apache.seata:seata-rm-datasource` 中已经存在了 
`com.fasterxml.jackson.datatype:jackson-datatype-jsr310`,但是并未起作用,原因在第2点。
   2. `org.apache.seata:seata-spring-boot-starter` 中引入了 
`org.apache.seata:seata-all`,`org.apache.seata:seata-all` 中引入了 
`org.apache.seata:seata-rm-datasource`,但是 `org.apache.seata:seata-all` 使用了 
plugin `org.apache.maven.plugins:maven-shade-plugin`,而 
`org.apache.maven.plugins:maven-shade-plugin` 的作用是将所有引入的 
`org.apache.seata:*`、`io.seata:*` 依赖,合并为一个 `jar`。佐证如下:
       1. https://github.com/apache/incubator-seata/tree/v2.6.0/all 并不包含任何 java 
代码
       2. 而 https://github.com/apache/incubator-seata/tree/v2.6.0/all 打包后的 
`org.apache.seata:seata-all:2.6.0:jar` 确包含 java 代码
           <img width="1764" height="1024" alt="image" 
src="https://github.com/user-attachments/assets/81bee311-75f4-4f83-85f5-1803364befce";
 />
   3. 如果不太了解 `org.apache.maven.plugins:maven-shade-plugin`,可以使用命令 `mvn 
dependency:tree -pl 
spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-seata -am > 
tree.txt` 分析一下 https://github.com/alibaba/spring-cloud-alibaba/ 的 2025.1.x 
分支最新代码 
https://github.com/alibaba/spring-cloud-alibaba/tree/0905316f2a3beb7fa9531871cb7ab64755bd46f8
 ,你将看到,只有 
`org.apache.seata:seata-spring-boot-starter:jar:2.6.0:compile`、`org.apache.seata:seata-spring-autoconfigure-client:jar:2.6.0:compile`、`org.apache.seata:seata-spring-autoconfigure-core:jar:2.6.0:compile`、`org.apache.seata:seata-all:jar:2.6.0:compile`
 四个 `org.apache.seata:*` 的依赖,并不包含 `org.apache.seata:seata-rm-datasource`,原因在第2点。
       [tree.txt](https://github.com/user-attachments/files/26382912/tree.txt)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to