You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2021/11/25 06:20:06 UTC

[dubbo] 20/45: repackage alibaba spring-context-support

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

liujun pushed a commit to branch release/3.0.14-rpccontext-bugfix
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit 338b6c948ecfa7f9769a434f970a9643c44abd48
Author: 赫炎 <de...@alibaba-inc.com>
AuthorDate: Fri Nov 27 20:53:53 2020 +0800

    repackage alibaba spring-context-support
---
 dubbo-all/pom.xml                        |  4 ----
 dubbo-config/dubbo-config-spring/pom.xml | 37 ++++++++++++++++++++++++++++++++
 dubbo-dependencies-bom/pom.xml           | 10 ---------
 pom.xml                                  |  3 +++
 4 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/dubbo-all/pom.xml b/dubbo-all/pom.xml
index 5c2936e..2efd9d5 100644
--- a/dubbo-all/pom.xml
+++ b/dubbo-all/pom.xml
@@ -551,10 +551,6 @@
             <artifactId>spring-context</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.alibaba.spring</groupId>
-            <artifactId>spring-context-support</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.javassist</groupId>
             <artifactId>javassist</artifactId>
         </dependency>
diff --git a/dubbo-config/dubbo-config-spring/pom.xml b/dubbo-config/dubbo-config-spring/pom.xml
index 74cc929..f8ab004 100644
--- a/dubbo-config/dubbo-config-spring/pom.xml
+++ b/dubbo-config/dubbo-config-spring/pom.xml
@@ -27,6 +27,7 @@
     <description>The spring config module of dubbo project</description>
     <properties>
         <skip_maven_deploy>false</skip_maven_deploy>
+        <alibaba_spring_context_support_version>1.0.6</alibaba_spring_context_support_version>
     </properties>
     <dependencies>
         <dependency>
@@ -52,9 +53,13 @@
             <scope>provided</scope>
         </dependency>
 
+        <!-- spring-context-support is repackaged at build time,
+            its dependencies cannot be passed, and cannot be managed in bom -->
         <dependency>
             <groupId>com.alibaba.spring</groupId>
             <artifactId>spring-context-support</artifactId>
+            <version>${alibaba_spring_context_support_version}</version>
+            <optional>true</optional>
         </dependency>
 
         <!-- Testing Dependencies -->
@@ -162,4 +167,36 @@
         </dependency>
 
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <createSourcesJar>true</createSourcesJar>
+                            <promoteTransitiveDependencies>false</promoteTransitiveDependencies>
+                            <artifactSet>
+                                <includes>
+                                    <include>com.alibaba.spring:spring-context-support:*:*</include>
+                                </includes>
+                            </artifactSet>
+                            <relocations>
+                                <relocation>
+                                    <pattern>com.alibaba.spring</pattern>
+                                    <shadedPattern>${dubbo.deps.package}.com.alibaba.spring</shadedPattern>
+                                </relocation>
+                            </relocations>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml
index d98f295..5c09127 100644
--- a/dubbo-dependencies-bom/pom.xml
+++ b/dubbo-dependencies-bom/pom.xml
@@ -145,9 +145,6 @@
         <!-- Eureka -->
         <eureka.version>1.9.12</eureka.version>
 
-        <!-- Alibaba -->
-        <alibaba_spring_context_support_version>1.0.6</alibaba_spring_context_support_version>
-
         <jaxb_version>2.2.7</jaxb_version>
         <activation_version>1.2.0</activation_version>
         <test_container_version>1.11.2</test_container_version>
@@ -282,13 +279,6 @@
                 <version>${eureka.version}</version>
             </dependency>
 
-            <!-- Alibaba -->
-            <dependency>
-                <groupId>com.alibaba.spring</groupId>
-                <artifactId>spring-context-support</artifactId>
-                <version>${alibaba_spring_context_support_version}</version>
-            </dependency>
-
             <dependency>
                 <groupId>com.googlecode.xmemcached</groupId>
                 <artifactId>xmemcached</artifactId>
diff --git a/pom.xml b/pom.xml
index 67e4ed7..e4725d4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -105,6 +105,9 @@
         <project.build.sourceEncoding>${file_encoding}</project.build.sourceEncoding>
         <project.build.outputTimestamp>2020-04-01T08:04:00Z</project.build.outputTimestamp>
 
+        <!-- dependency repackage prefix -->
+        <dubbo.deps.package>org.apache.dubbo.deps</dubbo.deps.package>
+
         <profile.name>oss</profile.name>
         <!-- for maven compiler plugin -->
         <java_source_version>1.8</java_source_version>