Optimize the nacos-client/pom.xml for exclude google/**/*.proto (#9982)

* Optimize the pom.xml of the nacos-client

* optimize pom

* exclude `google/**/*.proto`

* tab

* Remove dependency `io.grpc:protoc-gen-grpc-java:${version}:pom`

* revert indent

* revert native-image
This commit is contained in:
WangLiang/王良 2023-03-01 09:42:15 +08:00 committed by GitHub
parent 5a8f6f5f6a
commit a397c10a54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 154 additions and 430 deletions

View File

@ -29,12 +29,6 @@
<name>nacos-address ${project.version}</name> <name>nacos-address ${project.version}</name>
<url>https://nacos.io</url> <url>https://nacos.io</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>

View File

@ -50,22 +50,9 @@
</execution> </execution>
</executions> </executions>
</plugin>--> </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
@ -105,11 +92,6 @@
<groupId>com.google.protobuf</groupId> <groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId> <artifactId>protobuf-java</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>protoc-gen-grpc-java</artifactId>
<type>pom</type>
</dependency>
<dependency> <dependency>
<groupId>javax.annotation</groupId> <groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId> <artifactId>javax.annotation-api</artifactId>

View File

@ -31,10 +31,6 @@
<name>nacos-auth ${project.version}</name> <name>nacos-auth ${project.version}</name>
<url>https://nacos.io</url> <url>https://nacos.io</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>
@ -60,17 +56,4 @@
<artifactId>tomcat-embed-core</artifactId> <artifactId>tomcat-embed-core</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -31,10 +31,6 @@
<name>nacos-client ${project.version}</name> <name>nacos-client ${project.version}</name>
<url>https://nacos.io</url> <url>https://nacos.io</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
@ -125,25 +121,9 @@
</dependencies> </dependencies>
<build> <build>
<pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release-sign-artifacts</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version> <version>3.2.4</version>
<configuration> <configuration>
@ -160,6 +140,9 @@
<promoteTransitiveDependencies>true</promoteTransitiveDependencies> <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<createDependencyReducedPom>false</createDependencyReducedPom> <createDependencyReducedPom>false</createDependencyReducedPom>
<minimizeJar>true</minimizeJar> <minimizeJar>true</minimizeJar>
<createSourcesJar>true</createSourcesJar>
<shadeSourcesContent>true</shadeSourcesContent>
<filters> <filters>
<filter> <filter>
<artifact>*:*</artifact> <artifact>*:*</artifact>
@ -177,6 +160,14 @@
</exclude> </exclude>
</excludes> </excludes>
</filter> </filter>
<filter>
<artifact>com.google.*:*</artifact>
<excludes>
<exclude>
google/**/*.proto
</exclude>
</excludes>
</filter>
<filter> <filter>
<artifact>com.alibaba.nacos:nacos-api</artifact> <artifact>com.alibaba.nacos:nacos-api</artifact>
<includes> <includes>
@ -188,10 +179,7 @@
</include> </include>
</includes> </includes>
</filter> </filter>
</filters> </filters>
<createSourcesJar>true</createSourcesJar>
<shadeSourcesContent>true</shadeSourcesContent>
<artifactSet> <artifactSet>
<includes> <includes>
@ -211,11 +199,9 @@
<include>org.checkerframework:*</include> <include>org.checkerframework:*</include>
<include>org.codehaus.mojo:*</include> <include>org.codehaus.mojo:*</include>
</includes> </includes>
</artifactSet> </artifactSet>
<relocations> <relocations>
<relocation> <relocation>
<pattern>io.grpc</pattern> <pattern>io.grpc</pattern>
<shadedPattern>com.alibaba.nacos.shaded.io.grpc</shadedPattern> <shadedPattern>com.alibaba.nacos.shaded.io.grpc</shadedPattern>
@ -266,19 +252,30 @@
<pattern>org.example</pattern> <pattern>org.example</pattern>
<shadedPattern>com.alibaba.nacos.shaded.org.example</shadedPattern> <shadedPattern>com.alibaba.nacos.shaded.org.example</shadedPattern>
</relocation> </relocation>
</relocations> </relocations>
<transformers> <transformers>
<transformer <transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/> implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/>
<transformer <transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers> </transformers>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>release-sign-artifacts</id>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
</plugin>
<plugin> <plugin>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<executions> <executions>
@ -302,141 +299,7 @@
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<createDependencyReducedPom>false</createDependencyReducedPom>
<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>
<include>
META-INF/**/*.*
</include>
</includes>
</filter>
</filters>
<createSourcesJar>true</createSourcesJar>
<shadeSourcesContent>true</shadeSourcesContent>
<artifactSet>
<includes>
<include>com.alibaba.nacos:nacos-api</include>
<include>com.alibaba.nacos:nacos-common</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>
<excludes>
<exclude>io.grpc.netty.shaded.io.grpc.netty.*</exclude>
</excludes>
</relocation>
<relocation>
<pattern>io.grpc.netty.shaded.io.grpc.netty</pattern>
<shadedPattern>com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.grpc.netty
</shadedPattern>
<includes>
<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>
</relocation>
<relocation>
<pattern>io.opencensus</pattern>
<shadedPattern>com.alibaba.nacos.shaded.io.opencensus</shadedPattern>
</relocation>
<relocation>
<pattern>org.codehaus</pattern>
<shadedPattern>com.alibaba.nacos.shaded.org.codehaus</shadedPattern>
</relocation>
<relocation>
<pattern>org.checkerframework</pattern>
<shadedPattern>com.alibaba.nacos.shaded.org.checkerframework</shadedPattern>
</relocation>
<relocation>
<pattern>android.annotation</pattern>
<shadedPattern>com.alibaba.nacos.shaded.android.annotation</shadedPattern>
</relocation>
<relocation>
<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>
</executions>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>

View File

@ -32,12 +32,6 @@
<name>nacos-cmdb ${project.version}</name> <name>nacos-cmdb ${project.version}</name>
<url>https://nacos.io</url> <url>https://nacos.io</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>

View File

@ -32,10 +32,6 @@
<name>nacos-common ${project.version}</name> <name>nacos-common ${project.version}</name>
<url>https://nacos.io</url> <url>https://nacos.io</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
@ -68,16 +64,6 @@
</dependencies> </dependencies>
<build> <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>

View File

@ -31,10 +31,6 @@
<name>nacos-config ${project.version}</name> <name>nacos-config ${project.version}</name>
<url>https://nacos.io</url> <url>https://nacos.io</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

View File

@ -50,14 +50,6 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
@ -90,10 +82,6 @@
<version>${revision}</version> <version>${revision}</version>
</parent> </parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<url>https://nacos.io</url> <url>https://nacos.io</url>
</project> </project>

View File

@ -27,9 +27,6 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<name>nacos-console ${project.version}</name> <name>nacos-console ${project.version}</name>
<url>https://nacos.io</url> <url>https://nacos.io</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>

View File

@ -32,22 +32,6 @@
<name>nacos-core ${project.version}</name> <name>nacos-core ${project.version}</name>
<url>https://nacos.io</url> <url>https://nacos.io</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
@ -160,12 +144,6 @@
</dependency> </dependency>
<!-- micrometer end --> <!-- micrometer end -->
<dependency>
<groupId>io.grpc</groupId>
<artifactId>protoc-gen-grpc-java</artifactId>
<type>pom</type>
</dependency>
<dependency> <dependency>
<groupId>io.grpc</groupId> <groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId> <artifactId>grpc-testing</artifactId>

View File

@ -33,10 +33,6 @@
<name>nacos-example ${project.version}</name> <name>nacos-example ${project.version}</name>
<url>https://nacos.io</url> <url>https://nacos.io</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>

View File

@ -71,12 +71,6 @@
<groupId>com.google.protobuf</groupId> <groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId> <artifactId>protobuf-java</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>protoc-gen-grpc-java</artifactId>
<type>pom</type>
</dependency>
<!-- https://mvnrepository.com/artifact/io.envoyproxy.controlplane/api -->
<dependency> <dependency>
<groupId>io.envoyproxy.controlplane</groupId> <groupId>io.envoyproxy.controlplane</groupId>
<artifactId>api</artifactId> <artifactId>api</artifactId>

View File

@ -33,12 +33,6 @@
<name>nacos-naming ${project.version}</name> <name>nacos-naming ${project.version}</name>
<url>https://nacos.io</url> <url>https://nacos.io</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>

16
pom.xml
View File

@ -92,8 +92,9 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Compiler settings properties --> <!-- Compiler settings properties -->
<maven.compiler.source>1.8</maven.compiler.source> <java.version>1.8</java.version>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<!-- Maven properties --> <!-- Maven properties -->
<maven.test.skip>false</maven.test.skip> <maven.test.skip>false</maven.test.skip>
<maven.javadoc.skip>true</maven.javadoc.skip> <maven.javadoc.skip>true</maven.javadoc.skip>
@ -107,6 +108,7 @@
<maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version> <maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
<maven-javadoc-plugin.version>2.10.4</maven-javadoc-plugin.version> <maven-javadoc-plugin.version>2.10.4</maven-javadoc-plugin.version>
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
<maven-source-plugin.version>3.0.1</maven-source-plugin.version> <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
<maven-pmd-plugin.version>3.8</maven-pmd-plugin.version> <maven-pmd-plugin.version>3.8</maven-pmd-plugin.version>
<apache-rat-plugin.version>0.12</apache-rat-plugin.version> <apache-rat-plugin.version>0.12</apache-rat-plugin.version>
@ -161,6 +163,10 @@
<build> <build>
<pluginManagement> <pluginManagement>
<plugins> <plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
</plugin>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
@ -956,12 +962,6 @@
<artifactId>grpc-stub</artifactId> <artifactId>grpc-stub</artifactId>
<version>${grpc-java.version}</version> <version>${grpc-java.version}</version>
</dependency> </dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>protoc-gen-grpc-java</artifactId>
<version>${grpc-java.version}</version>
<type>pom</type>
</dependency>
<dependency> <dependency>
<groupId>io.grpc</groupId> <groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId> <artifactId>grpc-testing</artifactId>

View File

@ -31,10 +31,6 @@
<name>nacos-sys ${project.version}</name> <name>nacos-sys ${project.version}</name>
<url>https://nacos.io</url> <url>https://nacos.io</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>
@ -76,17 +72,4 @@
<artifactId>nacos-custom-environment-plugin</artifactId> <artifactId>nacos-custom-environment-plugin</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -36,10 +36,6 @@
<module>core-test</module> <module>core-test</module>
</modules> </modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>