[ISSUE#7929] minijar pom update ,to reduce nacos-client jar size (#9299)

* minijar

* minijar,add google shaded

* fix naming response miss

* not shaded promethus snakeyaml

* release-sign-artifacts minijar
This commit is contained in:
nov.lzf 2022-10-12 14:13:28 +08:00 committed by GitHub
parent 2051855117
commit 0fdda8c3fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,7 +145,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<version>3.2.4</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
@ -159,25 +159,56 @@
<keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<createDependencyReducedPom>false</createDependencyReducedPom>
<minimizeJar>false</minimizeJar>
<minimizeJar>true</minimizeJar>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
<filter>
<artifact>io.grpc:grpc-netty-shaded</artifact>
<excludes>
<exclude>
META-INF/native/*.*
</exclude>
</excludes>
</filter>
<filter>
<artifact>com.alibaba.nacos:nacos-api</artifact>
<includes>
<include>
com/alibaba/nacos/api/**/**
</include>
</includes>
</filter>
</filters>
<createSourcesJar>true</createSourcesJar>
<shadeSourcesContent>true</shadeSourcesContent>
<artifactSet>
<includes>
<include>io.grpc:*</include>
<include>io.opencensus:*</include>
<include>io.perfmark:*</include>
<include>com.google.guava:guava</include>
<include>com.google.guava:failureaccess</include>
<include>com.google.errorprone:error_prone_annotations</include>
<include>com.google.j2objc:j2objc-annotations</include>
<include>com.google.code.gson:gson</include>
<include>com.google.protobuf:protobuf-java</include>
<include>com.alibaba.nacos:nacos-api</include>
<include>com.alibaba.nacos:nacos-common</include>
<include>org.checkerframework:checker-qual</include>
<include>org.conscrypt:conscrypt-openjdk</include>
<include>org.mortbay.jetty.alpn:alpn-boot</include>
<include>org.eclipse.jetty.npn:npn-api</include>
<include>org.reflections:reflections</include>
<include>com.google.guava:guava</include>
<include>io.grpc:*</include>
<include>io.opencensus:*</include>
<include>org.javassist:*</include>
<include>io.perfmark:perfmark-api</include>
<include>com.google.*:*</include>
<include>javax.annotation:javax.annotation-api</include>
<include>org.checkerframework:*</include>
<include>org.codehaus.mojo:*</include>
</includes>
</artifactSet>
<relocations>
@ -202,6 +233,12 @@
<pattern>com.google</pattern>
<shadedPattern>com.alibaba.nacos.shaded.com.google</shadedPattern>
</relocation>
<relocation>
<pattern>javax.annotation</pattern>
<shadedPattern>com.alibaba.nacos.shaded.javax.annotation</shadedPattern>
</relocation>
<relocation>
<pattern>io.perfmark</pattern>
<shadedPattern>com.alibaba.nacos.shaded.io.perfmark</shadedPattern>
@ -227,7 +264,6 @@
<shadedPattern>com.alibaba.nacos.shaded.org.example</shadedPattern>
</relocation>
</relocations>
<transformers>
<transformer
@ -265,7 +301,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<version>3.2.4</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
@ -279,29 +315,60 @@
<keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<createDependencyReducedPom>false</createDependencyReducedPom>
<minimizeJar>false</minimizeJar>
<minimizeJar>true</minimizeJar>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
<filter>
<artifact>io.grpc:grpc-netty-shaded</artifact>
<excludes>
<exclude>
META-INF/native/*.*
</exclude>
</excludes>
</filter>
<filter>
<artifact>com.alibaba.nacos:nacos-api</artifact>
<includes>
<include>
com/alibaba/nacos/api/**/**
</include>
</includes>
</filter>
</filters>
<createSourcesJar>true</createSourcesJar>
<shadeSourcesContent>true</shadeSourcesContent>
<artifactSet>
<includes>
<include>io.grpc:*</include>
<include>io.opencensus:*</include>
<include>io.perfmark:*</include>
<include>com.google.guava:guava</include>
<include>com.google.guava:failureaccess</include>
<include>com.google.errorprone:error_prone_annotations</include>
<include>com.google.j2objc:j2objc-annotations</include>
<include>com.google.code.gson:gson</include>
<include>com.google.protobuf:protobuf-java</include>
<include>com.alibaba.nacos:nacos-api</include>
<include>com.alibaba.nacos:nacos-common</include>
<include>org.checkerframework:checker-qual</include>
<include>org.conscrypt:conscrypt-openjdk</include>
<include>org.mortbay.jetty.alpn:alpn-boot</include>
<include>org.eclipse.jetty.npn:npn-api</include>
<include>org.reflections:reflections</include>
<include>com.google.guava:guava</include>
<include>io.grpc:*</include>
<include>io.opencensus:*</include>
<include>org.javassist:*</include>
<include>io.perfmark:perfmark-api</include>
<include>com.google.*:*</include>
<include>javax.annotation:javax.annotation-api</include>
<include>org.checkerframework:*</include>
<include>org.codehaus.mojo:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>io.grpc</pattern>
<shadedPattern>com.alibaba.nacos.shaded.io.grpc</shadedPattern>
@ -317,11 +384,17 @@
<include>io.grpc.netty.shaded.io.grpc.netty.*</include>
</includes>
</relocation>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>com.alibaba.nacos.shaded.com.google</shadedPattern>
</relocation>
<relocation>
<pattern>javax.annotation</pattern>
<shadedPattern>com.alibaba.nacos.shaded.javax.annotation</shadedPattern>
</relocation>
<relocation>
<pattern>io.perfmark</pattern>
<shadedPattern>com.alibaba.nacos.shaded.io.perfmark</shadedPattern>
@ -346,15 +419,14 @@
<pattern>org.example</pattern>
<shadedPattern>com.alibaba.nacos.shaded.org.example</shadedPattern>
</relocation>
</relocations>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>