Upgrade dependency to reduce conflicts and add leak UT coverage files. (#11396)
* Remove custom jackson version and jackson-core-asl. * Upgrade protobuf relative version to reduce conflict with grpc. * 补充提交遗漏单测覆盖率的模块。
This commit is contained in:
parent
167630edec
commit
03987330a4
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -46,4 +46,4 @@ jobs:
|
||||
- name: "Codecov"
|
||||
uses: codecov/codecov-action@v3.1.0
|
||||
with:
|
||||
files: ./address/target/site/jacoco/jacoco.xml,./api/target/site/jacoco/jacoco.xml,./auth/target/site/jacoco/jacoco.xml,./client/target/site/jacoco/jacoco.xml,./common/target/site/jacoco/jacoco.xml,./consistency/target/site/jacoco/jacoco.xml,./console/target/site/jacoco/jacoco.xml,./core/target/site/jacoco/jacoco.xml,./naming/target/site/jacoco/jacoco.xml,./plugin-default-impl/target/site/jacoco/jacoco.xml,./plugin/auth/target/site/jacoco/jacoco.xml,./plugin/encryption/target/site/jacoco/jacoco.xml,./sys/target/site/jacoco/jacoco.xml
|
||||
files: ./address/target/site/jacoco/jacoco.xml,./api/target/site/jacoco/jacoco.xml,./auth/target/site/jacoco/jacoco.xml,./client/target/site/jacoco/jacoco.xml,./common/target/site/jacoco/jacoco.xml,./consistency/target/site/jacoco/jacoco.xml,./console/target/site/jacoco/jacoco.xml,./core/target/site/jacoco/jacoco.xml,./naming/target/site/jacoco/jacoco.xml,./persistence/target/site/jacoco/jacoco.xml,./plugin-default-impl/nacos-default-auth-plugin/target/site/jacoco/jacoco.xml,./plugin/auth/target/site/jacoco/jacoco.xml,./plugin/config/target/site/jacoco/jacoco.xml,./plugin/control/target/site/jacoco/jacoco.xml,./plugin/datasource/target/site/jacoco/jacoco.xml,./plugin/encryption/target/site/jacoco/jacoco.xml,./plugin/environment/target/site/jacoco/jacoco.xml,./plugin/trace/target/site/jacoco/jacoco.xml,./prometheus/target/site/jacoco/jacoco.xml,./sys/target/site/jacoco/jacoco.xml
|
||||
|
@ -62,10 +62,6 @@
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-core-asl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
@ -16,10 +16,10 @@
|
||||
|
||||
package com.alibaba.nacos.naming.push;
|
||||
|
||||
import com.alibaba.nacos.naming.misc.UtilsAndCommons;
|
||||
import com.alibaba.nacos.common.utils.StringUtils;
|
||||
import org.codehaus.jackson.Version;
|
||||
import org.codehaus.jackson.util.VersionUtil;
|
||||
import com.alibaba.nacos.naming.misc.UtilsAndCommons;
|
||||
import com.fasterxml.jackson.core.Version;
|
||||
import com.fasterxml.jackson.core.util.VersionUtil;
|
||||
|
||||
/**
|
||||
* Client info.
|
||||
@ -49,7 +49,7 @@ public class ClientInfo {
|
||||
if (versionStartIndex < 0) {
|
||||
return Version.unknownVersion();
|
||||
}
|
||||
return VersionUtil.parseVersion(versionStr.substring(versionStartIndex + 2));
|
||||
return VersionUtil.parseVersion(versionStr.substring(versionStartIndex + 2), null, null);
|
||||
}
|
||||
|
||||
public enum ClientType {
|
||||
|
@ -24,8 +24,9 @@ import com.alibaba.nacos.naming.misc.SwitchDomain;
|
||||
import com.alibaba.nacos.naming.pojo.Subscriber;
|
||||
import com.alibaba.nacos.naming.remote.udp.AckEntry;
|
||||
import com.alibaba.nacos.naming.remote.udp.UdpConnector;
|
||||
import com.fasterxml.jackson.core.Version;
|
||||
import com.fasterxml.jackson.core.util.VersionUtil;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.codehaus.jackson.util.VersionUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -153,25 +154,29 @@ public class UdpPushService {
|
||||
ClientInfo clientInfo = new ClientInfo(agent);
|
||||
|
||||
if (ClientInfo.ClientType.JAVA == clientInfo.type
|
||||
&& clientInfo.version.compareTo(VersionUtil.parseVersion(switchDomain.getPushJavaVersion())) >= 0) {
|
||||
&& clientInfo.version.compareTo(parseVersion(switchDomain.getPushJavaVersion())) >= 0) {
|
||||
return true;
|
||||
} else if (ClientInfo.ClientType.DNS == clientInfo.type
|
||||
&& clientInfo.version.compareTo(VersionUtil.parseVersion(switchDomain.getPushPythonVersion())) >= 0) {
|
||||
&& clientInfo.version.compareTo(parseVersion(switchDomain.getPushPythonVersion())) >= 0) {
|
||||
return true;
|
||||
} else if (ClientInfo.ClientType.C == clientInfo.type
|
||||
&& clientInfo.version.compareTo(VersionUtil.parseVersion(switchDomain.getPushCVersion())) >= 0) {
|
||||
&& clientInfo.version.compareTo(parseVersion(switchDomain.getPushCVersion())) >= 0) {
|
||||
return true;
|
||||
} else if (ClientInfo.ClientType.GO == clientInfo.type
|
||||
&& clientInfo.version.compareTo(VersionUtil.parseVersion(switchDomain.getPushGoVersion())) >= 0) {
|
||||
&& clientInfo.version.compareTo(parseVersion(switchDomain.getPushGoVersion())) >= 0) {
|
||||
return true;
|
||||
} else if (ClientInfo.ClientType.CSHARP == clientInfo.type
|
||||
&& clientInfo.version.compareTo(VersionUtil.parseVersion(switchDomain.getPushCSharpVersion())) >= 0) {
|
||||
&& clientInfo.version.compareTo(parseVersion(switchDomain.getPushCSharpVersion())) >= 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private Version parseVersion(String version) {
|
||||
return VersionUtil.parseVersion(version, null, null);
|
||||
}
|
||||
|
||||
private static byte[] compressIfNecessary(byte[] dataBytes) throws IOException {
|
||||
// enable compression when data is larger than 1KB
|
||||
int maxDataSizeUncompress = 1024;
|
||||
|
30
pom.xml
30
pom.xml
@ -137,15 +137,11 @@
|
||||
|
||||
<mysql-connector-java.version>8.0.28</mysql-connector-java.version>
|
||||
<derby.version>10.14.2.0</derby.version>
|
||||
<jackson-core.version>2.12.6</jackson-core.version>
|
||||
<jackson-databind.version>2.12.7.1</jackson-databind.version>
|
||||
<jackson.annotations.version>2.12.6</jackson.annotations.version>
|
||||
<jackson-core-asl.version>1.9.13</jackson-core-asl.version>
|
||||
<jjwt.version>0.11.2</jjwt.version>
|
||||
<javatuples.version>1.2</javatuples.version>
|
||||
<grpc-java.version>1.57.2</grpc-java.version>
|
||||
<proto-google-common-protos.version>2.7.1</proto-google-common-protos.version>
|
||||
<protobuf-java.version>3.21.11</protobuf-java.version>
|
||||
<proto-google-common-protos.version>2.17.0</proto-google-common-protos.version>
|
||||
<protobuf-java.version>3.22.3</protobuf-java.version>
|
||||
<protoc-gen-grpc-java.version>${grpc-java.version}</protoc-gen-grpc-java.version>
|
||||
<hessian.version>4.0.63</hessian.version>
|
||||
<mockito-all.version>1.10.19</mockito-all.version>
|
||||
@ -901,28 +897,6 @@
|
||||
</dependency>
|
||||
|
||||
<!-- Third-party libs -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>${jackson-core.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${jackson-databind.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>${jackson.annotations.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-core-asl</artifactId>
|
||||
<version>${jackson-core-asl.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-api</artifactId>
|
||||
|
10
sys/pom.xml
10
sys/pom.xml
@ -41,7 +41,7 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
@ -53,20 +53,16 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-core-asl</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-custom-environment-plugin</artifactId>
|
||||
|
Loading…
Reference in New Issue
Block a user