From c5d54e3eca13343b7cff9d8b6ebae7d5aefbda11 Mon Sep 17 00:00:00 2001
From: qingliu <shuiqingliu14@gmail.com>
Date: Mon, 29 May 2023 14:35:26 +0800
Subject: [PATCH] feat: sct-all package is now available as a shaded uber-jar
 (#1018)

Co-authored-by: Haotian Zhang <928016560@qq.com>
---
 CHANGELOG.md                             |  1 +
 pom.xml                                  |  6 ++++
 spring-cloud-starter-tencent-all/pom.xml | 38 ++++++++++++++++++++++++
 3 files changed, 45 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index dbd3e6981..3d878efb6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,4 +9,5 @@
 - [feat:refactor SDKContext as static.](https://github.com/Tencent/spring-cloud-tencent/pull/1005)
 - [docs:add release GitHub Action.](https://github.com/Tencent/spring-cloud-tencent/pull/1008)
 - [docs:update Polaris test environment ip.](https://github.com/Tencent/spring-cloud-tencent/pull/1011)
+- [feat:sct-all package is now available as a shaded uber-jar.](https://github.com/Tencent/spring-cloud-tencent/pull/1016)
 - [fix:fix custom fallback exception.](https://github.com/Tencent/spring-cloud-tencent/pull/1021)
diff --git a/pom.xml b/pom.xml
index 5773b4ea7..5f0bdf24c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,6 +104,7 @@
 		<maven-source-plugin.version>3.2.0</maven-source-plugin.version>
 		<flatten-maven-plugin.version>1.2.7</flatten-maven-plugin.version>
 		<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
+		<maven-shade-plugin.version>3.4.1</maven-shade-plugin.version>
 
 		<!--  Checkstyle      -->
 		<maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError>
@@ -160,6 +161,11 @@
 					<artifactId>jacoco-maven-plugin</artifactId>
 					<version>${jacoco.version}</version>
 				</plugin>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-shade-plugin</artifactId>
+					<version>${maven-shade-plugin.version}</version>
+				</plugin>
 			</plugins>
 		</pluginManagement>
 		<plugins>
diff --git a/spring-cloud-starter-tencent-all/pom.xml b/spring-cloud-starter-tencent-all/pom.xml
index f6fb8b38f..b12ac9324 100644
--- a/spring-cloud-starter-tencent-all/pom.xml
+++ b/spring-cloud-starter-tencent-all/pom.xml
@@ -57,4 +57,42 @@
 			<artifactId>spring-boot-starter-actuator</artifactId>
 		</dependency>
 	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-javadoc-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>attach-javadocs</id>
+						<phase>package</phase>
+						<goals>
+							<goal>jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-shade-plugin</artifactId>
+				<configuration>
+					<createSourcesJar>true</createSourcesJar>
+					<artifactSet>
+						<includes>
+							<include>com.tencent.cloud:spring-cloud-tencent</include>
+						</includes>
+					</artifactSet>
+				</configuration>
+				<executions>
+					<execution>
+						<phase>package</phase>
+						<goals>
+							<goal>shade</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
 </project>