Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE#12028] Re-adapt springboot 3 for nacos 2.5.0-snapshot #12798

Open
wants to merge 1 commit into
base: summer-ospp#12028
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private List<String> getServerListFromEndpoint() {
List<String> lines = IoUtils.readLines(new StringReader(httpResult.getData()));
List<String> result = new ArrayList<>(lines.size());
for (String serverAddr : lines) {
String[] ipPort = InternetAddressUtil.splitIPPortStr(serverAddr);
String[] ipPort = InternetAddressUtil.splitIpPortStr(serverAddr);
String ip = ipPort[0].trim();
if (ipPort.length == 1) {
result.add(ip + InternetAddressUtil.IP_PORT_SPLITER + ParamUtil.getDefaultServerPort());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void init(final NacosClientProperties properties, final NacosRestTemplate
if (serverAddr.startsWith(HTTP_PREFIX) || serverAddr.startsWith(HTTPS_PREFIX)) {
this.serverList.add(serverAddr);
} else {
String[] serverAddrArr = InternetAddressUtil.splitIPPortStr(serverAddr);
String[] serverAddrArr = InternetAddressUtil.splitIpPortStr(serverAddr);
if (serverAddrArr.length == 1) {
this.serverList
.add(serverAddrArr[0] + InternetAddressUtil.IP_PORT_SPLITER + ParamUtil.getDefaultServerPort());
Expand Down
40 changes: 0 additions & 40 deletions console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,6 @@
<hints.os.rocksdb>linux32.so</hints.os.rocksdb>
</properties>
</profile>
<profile>
<id>native-linux32-musl</id>
<properties>
<hints.os.rocksdb>linux32-musl.so</hints.os.rocksdb>
</properties>
</profile>
<profile>
<id>native-linux64</id>
<activation>
Expand All @@ -168,12 +162,6 @@
<hints.os.rocksdb>linux64.so</hints.os.rocksdb>
</properties>
</profile>
<profile>
<id>native-linux64-musl</id>
<properties>
<hints.os.rocksdb>linux64-musl.so</hints.os.rocksdb>
</properties>
</profile>
<profile>
<id>native-linux-aarch64</id>
<activation>
Expand All @@ -187,12 +175,6 @@
<hints.os.rocksdb>linux-aarch64.so</hints.os.rocksdb>
</properties>
</profile>
<profile>
<id>native-linux-aarch64-musl</id>
<properties>
<hints.os.rocksdb>linux-aarch64-musl.so</hints.os.rocksdb>
</properties>
</profile>
<profile>
<id>native-linux-ppc64le</id>
<activation>
Expand All @@ -206,12 +188,6 @@
<hints.os.rocksdb>linux-ppc64le.so</hints.os.rocksdb>
</properties>
</profile>
<profile>
<id>native-linux-ppc64le-musl</id>
<properties>
<hints.os.rocksdb>linux-ppc64le-musl.so</hints.os.rocksdb>
</properties>
</profile>
<profile>
<id>native-linux-s390x</id>
<activation>
Expand All @@ -225,22 +201,6 @@
<hints.os.rocksdb>linux-s390x.so</hints.os.rocksdb>
</properties>
</profile>
<profile>
<id>native-linux-s390x-musl</id>
<properties>
<hints.os.rocksdb>linux-s390x-musl.so</hints.os.rocksdb>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>librocksdbjni-${hints.os.rocksdb}</include>
</includes>
</resource>
</resources>
</build>
</profile>
<profile>
<id>native-osx-arm64</id>
<activation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@

package com.alibaba.nacos.console.aot;

import org.apache.derby.iapi.services.loader.InstanceGetter;
import org.apache.derby.iapi.services.monitor.Monitor;
import org.rocksdb.NativeLibraryLoader;

import java.lang.reflect.Field;
import java.util.HashSet;
import java.util.Set;

/**
* Help graalvm and spring-aot find specific native file from jar like rocksdb.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ public class NacosRuntimeHints implements RuntimeHintsRegistrar {
Class.forName("org.apache.derby.impl.services.monitor.TopService"),
Class.forName("org.apache.derby.iapi.services.cache.ClassSizeCatalogImpl"),

com.alibaba.nacos.persistence.datasource.ExternalDataSourceProperties.class,
com.mysql.cj.jdbc.Driver.class
com.alibaba.nacos.persistence.datasource.ExternalDataSourceProperties.class
};
// endregion

Expand Down Expand Up @@ -539,7 +538,6 @@ public class NacosRuntimeHints implements RuntimeHintsRegistrar {
com.alibaba.nacos.api.grpc.auto.Metadata.class,
com.alibaba.nacos.api.grpc.auto.Payload.class,
com.alibaba.nacos.naming.core.v2.client.ClientSyncData.class,
com.alibaba.nacos.naming.core.v2.client.ClientSyncData.class,
com.alibaba.nacos.naming.core.v2.metadata.InstanceMetadata.class,
com.alibaba.nacos.naming.core.v2.pojo.HealthCheckInstancePublishInfo.class,
com.alibaba.nacos.naming.core.v2.pojo.BatchInstancePublishInfo.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

/**
* annotation for invoke source.
*
* @author liuzunfei
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface InvokeSource {
Expand Down
27 changes: 27 additions & 0 deletions distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,32 @@
<finalName>nacos</finalName>
</build>
</profile>
<profile>
<id>release-native</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>release-native.xml</descriptor>
</descriptors>
<tarLongFileMode>posix</tarLongFileMode>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<finalName>nacos</finalName>
</build>
</profile>
</profiles>
</project>
81 changes: 81 additions & 0 deletions distribution/release-native.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 1999-2018 Alibaba Group Holding Ltd.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<assembly>
<id>server-${project.version}</id>
<includeBaseDirectory>true</includeBaseDirectory>
<formats>
<format>dir</format>
<format>tar.gz</format>
<format>zip</format>
</formats>
<fileSets>

<fileSet>
<includes>
<include>plugins/**</include>
</includes>
</fileSet>

<fileSet>
<includes>
<include>conf/**</include>
</includes>
</fileSet>

<fileSet>
<includes>
<include>bin/*</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>
<files>
<file>
<source>LICENSE-BIN</source>
<destName>LICENSE</destName>
</file>
<file>
<source>NOTICE-BIN</source>
<destName>NOTICE</destName>
</file>
<file>
<source>../console/target/nacos-server</source>
<outputDirectory>target/</outputDirectory>
</file>
<file>
<source>../console/target/nacos-server.exe</source>
<outputDirectory>target/</outputDirectory>
</file>
<file>
<source>../console/target/*.so</source>
<outputDirectory>target/</outputDirectory>
</file>
<file>
<source>../console/target/*.dll</source>
<outputDirectory>target/</outputDirectory>
</file>
</files>

<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>com.alibaba.nacos:nacos-console</include>
</includes>
</moduleSet>
</moduleSets>
</assembly>
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* @author nacos
*/
@Component
@SuppressWarnings("PMD")
public class SwitchDomain implements Record, Cloneable {

private static final long serialVersionUID = 7619505097145337232L;
Expand Down Expand Up @@ -74,7 +75,7 @@ public class SwitchDomain implements Record, Cloneable {

private long serviceStatusSynchronizationPeriodMillis = TimeUnit.SECONDS.toMillis(5);

private boolean disableAddIp = false;
private boolean disableAddIP = false;

private boolean sendBeatOnly = false;

Expand All @@ -90,11 +91,11 @@ public class SwitchDomain implements Record, Cloneable {
/**
* since which version, push can be enabled.
*/
private String pushGoVersion = "0.1.0";
private String pushVersionOfGo = "0.1.0";

private String pushJavaVersion = "0.1.0";
private String pushVersionOfJava = "0.1.0";

private String pushPythonVersion = "0.4.3";
private String pushVersionOfPython = "0.4.3";

private String pushVersionOfC = "1.0.12";

Expand Down Expand Up @@ -301,12 +302,12 @@ public void setServiceStatusSynchronizationPeriodMillis(long serviceStatusSynchr
this.serviceStatusSynchronizationPeriodMillis = serviceStatusSynchronizationPeriodMillis;
}

public boolean isDisableAddIp() {
return disableAddIp;
public boolean isDisableAddIP() {
return disableAddIP;
}

public void setDisableAddIp(boolean disableAddIp) {
this.disableAddIp = disableAddIp;
public void setDisableAddIP(boolean disableAddIP) {
this.disableAddIP = disableAddIP;
}

public Map<String, Integer> getLimitedUrlMap() {
Expand All @@ -325,44 +326,44 @@ public void setDistroServerExpiredMillis(long distroServerExpiredMillis) {
this.distroServerExpiredMillis = distroServerExpiredMillis;
}

public String getPushGoVersion() {
return pushGoVersion;
public String getPushVersionOfGo() {
return pushVersionOfGo;
}

public void setPushGoVersion(String pushGoVersion) {
this.pushGoVersion = pushGoVersion;
this.pushVersionOfGo = pushGoVersion;
}

public String getPushVersionOfCsharp() {
return pushVersionOfCsharp;
}

public void setPushVersionOfCsharp(String pushVersionOfCsharp) {
this.pushVersionOfCsharp = pushVersionOfCsharp;
public void setPushCSharpVersion(String pushCSharpVersion) {
this.pushVersionOfCsharp = pushCSharpVersion;
}

public String getPushJavaVersion() {
return pushJavaVersion;
public String getPushVersionOfJava() {
return pushVersionOfJava;
}

public void setPushJavaVersion(String pushJavaVersion) {
this.pushJavaVersion = pushJavaVersion;
this.pushVersionOfJava = pushJavaVersion;
}

public String getPushPythonVersion() {
return pushPythonVersion;
public String getPushVersionOfPython() {
return pushVersionOfPython;
}

public void setPushPythonVersion(String pushPythonVersion) {
this.pushPythonVersion = pushPythonVersion;
this.pushVersionOfPython = pushPythonVersion;
}

public String getPushVersionOfC() {
return pushVersionOfC;
}

public void setPushVersionOfC(String pushVersionOfC) {
this.pushVersionOfC = pushVersionOfC;
public void setPushCVersion(String pushCVersion) {
this.pushVersionOfC = pushCVersion;
}

public String getOverriddenServerStatus() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public SwitchManager(SwitchDomain switchDomain, ProtocolManager protocolManager)
* @param debug whether debug
* @throws Exception exception
*/
@SuppressWarnings("PMD")
public void update(String entry, String value, boolean debug) throws Exception {

this.requestLock.lock();
Expand Down Expand Up @@ -348,11 +349,11 @@ public void update(SwitchDomain newSwitchDomain) {
switchDomain.setSendBeatOnly(newSwitchDomain.isSendBeatOnly());
switchDomain.setLimitedUrlMap(newSwitchDomain.getLimitedUrlMap());
switchDomain.setDistroServerExpiredMillis(newSwitchDomain.getDistroServerExpiredMillis());
switchDomain.setPushGoVersion(newSwitchDomain.getPushGoVersion());
switchDomain.setPushJavaVersion(newSwitchDomain.getPushJavaVersion());
switchDomain.setPushPythonVersion(newSwitchDomain.getPushPythonVersion());
switchDomain.setPushCVersion(newSwitchDomain.getPushCVersion());
switchDomain.setPushCSharpVersion(newSwitchDomain.getPushCSharpVersion());
switchDomain.setPushGoVersion(newSwitchDomain.getPushVersionOfGo());
switchDomain.setPushJavaVersion(newSwitchDomain.getPushVersionOfJava());
switchDomain.setPushPythonVersion(newSwitchDomain.getPushVersionOfPython());
switchDomain.setPushCVersion(newSwitchDomain.getPushVersionOfC());
switchDomain.setPushCSharpVersion(newSwitchDomain.getPushVersionOfCsharp());
switchDomain.setEnableAuthentication(newSwitchDomain.isEnableAuthentication());
switchDomain.setOverriddenServerStatus(newSwitchDomain.getOverriddenServerStatus());
switchDomain.setDefaultInstanceEphemeral(newSwitchDomain.isDefaultInstanceEphemeral());
Expand Down
Loading
Loading