mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Merge remote-tracking branch 'upstream/1.x' into 1.x
This commit is contained in:
commit
21c5b964f2
40
.circleci/config.yml
Normal file
40
.circleci/config.yml
Normal file
@ -0,0 +1,40 @@
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: springcloud/pipeline-base
|
||||
user: appuser
|
||||
environment:
|
||||
_JAVA_OPTIONS: "-Xms1024m -Xmx2048m"
|
||||
TERM: dumb
|
||||
branches:
|
||||
ignore:
|
||||
- gh-pages # list of branches to ignore
|
||||
resource_class: large
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: sc-alibaba-{{ .Branch }}
|
||||
- run:
|
||||
name: "Download dependencies"
|
||||
command: ./mvnw -Pspring -U --fail-never dependency:go-offline || true
|
||||
- save_cache:
|
||||
key: sc-alibaba-{{ .Branch }}
|
||||
paths:
|
||||
- ~/.m2
|
||||
- run:
|
||||
name: "Running build"
|
||||
command: ./mvnw -Pspring clean install -U -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
||||
- run:
|
||||
name: "Aggregate test results"
|
||||
when: always
|
||||
command: |
|
||||
mkdir -p ~/junit/
|
||||
find . -type f -regex ".*/target/.*-reports/.*" -exec cp {} ~/junit/ \;
|
||||
bash <(curl -s https://codecov.io/bash)
|
||||
- store_artifacts:
|
||||
path: ~/junit/
|
||||
destination: artifacts
|
||||
- store_test_results:
|
||||
path: ~/junit/
|
||||
destination: testartifacts
|
2
pom.xml
2
pom.xml
@ -14,7 +14,7 @@
|
||||
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Cloud Alibaba</name>
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
<relativePath/>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Cloud Alibaba Dependencies</name>
|
||||
<description>Spring Cloud Alibaba Dependencies</description>
|
||||
@ -18,7 +18,7 @@
|
||||
<properties>
|
||||
<sentinel.version>0.2.0</sentinel.version>
|
||||
<oss.version>3.1.0</oss.version>
|
||||
<nacos.version>0.2.1</nacos.version>
|
||||
<nacos.version>0.3.0-RC1</nacos.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-examples</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>nacos-discovery-example</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>nacos-discovery-example</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-examples</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-examples</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-examples</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-examples</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-examples</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-examples</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>../../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.cloud.alibaba.nacos;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
@ -48,12 +47,6 @@ public class NacosDiscoveryAutoConfiguration {
|
||||
return new NacosServiceRegistry();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public NacosDiscoveryProperties nacosProperties() {
|
||||
return new NacosDiscoveryProperties();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(AutoServiceRegistrationProperties.class)
|
||||
public NacosRegistration nacosRegistration() {
|
||||
|
@ -19,11 +19,10 @@ package org.springframework.cloud.alibaba.nacos;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.alibaba.nacos.registry.NacosRegistration;
|
||||
import org.springframework.cloud.client.DefaultServiceInstance;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.*;
|
||||
|
||||
import com.alibaba.nacos.api.naming.NamingService;
|
||||
@ -40,7 +39,7 @@ public class NacosDiscoveryClient implements DiscoveryClient {
|
||||
public static final String DESCRIPTION = "Spring Cloud Nacos Discovery Client";
|
||||
|
||||
@Autowired
|
||||
private NacosRegistration nacosRegistration;
|
||||
private NacosDiscoveryProperties discoveryProperties;
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
@ -49,44 +48,19 @@ public class NacosDiscoveryClient implements DiscoveryClient {
|
||||
|
||||
@Override
|
||||
public ServiceInstance getLocalServiceInstance() {
|
||||
return new ServiceInstance() {
|
||||
@Override
|
||||
public String getServiceId() {
|
||||
return nacosRegistration.getServiceId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHost() {
|
||||
return nacosRegistration.getHost();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPort() {
|
||||
return nacosRegistration.getPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSecure() {
|
||||
return nacosRegistration.isSecure();
|
||||
}
|
||||
|
||||
@Override
|
||||
public URI getUri() {
|
||||
return nacosRegistration.getUri();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getMetadata() {
|
||||
return nacosRegistration.getMetadata();
|
||||
}
|
||||
};
|
||||
String serviceId = discoveryProperties.getService();
|
||||
String host = discoveryProperties.getIp();
|
||||
int port = discoveryProperties.getPort();
|
||||
boolean secure = discoveryProperties.isSecure();
|
||||
Map<String, String> metadata = discoveryProperties.getMetadata();
|
||||
return new DefaultServiceInstance(serviceId, host, port, secure, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ServiceInstance> getInstances(String serviceId) {
|
||||
try {
|
||||
NamingService namingService = nacosRegistration.getNacosNamingService();
|
||||
List<Instance> instances = namingService.getAllInstances(serviceId);
|
||||
List<Instance> instances = discoveryProperties.namingServiceInstance()
|
||||
.getAllInstances(serviceId);
|
||||
return hostToServiceInstanceList(instances, serviceId);
|
||||
}
|
||||
catch (Exception e) {
|
||||
@ -126,9 +100,8 @@ public class NacosDiscoveryClient implements DiscoveryClient {
|
||||
public List<String> getServices() {
|
||||
|
||||
try {
|
||||
NamingService namingService = nacosRegistration.getNacosNamingService();
|
||||
ListView<String> services = namingService.getServicesOfServer(1,
|
||||
Integer.MAX_VALUE);
|
||||
ListView<String> services = discoveryProperties.namingServiceInstance()
|
||||
.getServicesOfServer(1, Integer.MAX_VALUE);
|
||||
return services.getData();
|
||||
}
|
||||
catch (Exception e) {
|
||||
@ -137,4 +110,7 @@ public class NacosDiscoveryClient implements DiscoveryClient {
|
||||
}
|
||||
}
|
||||
|
||||
public NamingService getNamingService() {
|
||||
return discoveryProperties.namingServiceInstance();
|
||||
}
|
||||
}
|
||||
|
@ -36,4 +36,10 @@ public class NacosDiscoveryClientAutoConfiguration {
|
||||
return new NacosDiscoveryClient();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public NacosDiscoveryProperties nacosProperties() {
|
||||
return new NacosDiscoveryProperties();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.cloud.alibaba.nacos;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ -33,6 +35,18 @@ import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
|
||||
import com.alibaba.nacos.api.NacosFactory;
|
||||
import com.alibaba.nacos.api.naming.NamingService;
|
||||
import com.alibaba.nacos.client.naming.utils.UtilAndComs;
|
||||
|
||||
import static com.alibaba.nacos.api.PropertyKeyConst.ACCESS_KEY;
|
||||
import static com.alibaba.nacos.api.PropertyKeyConst.CLUSTER_NAME;
|
||||
import static com.alibaba.nacos.api.PropertyKeyConst.ENDPOINT;
|
||||
import static com.alibaba.nacos.api.PropertyKeyConst.NAMESPACE;
|
||||
import static com.alibaba.nacos.api.PropertyKeyConst.SECRET_KEY;
|
||||
import static com.alibaba.nacos.api.PropertyKeyConst.SERVER_ADDR;
|
||||
|
||||
/**
|
||||
* @author dungu.zpf
|
||||
@ -42,6 +56,9 @@ import java.util.Objects;
|
||||
@ConfigurationProperties("spring.cloud.nacos.discovery")
|
||||
public class NacosDiscoveryProperties {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory
|
||||
.getLogger(NacosDiscoveryProperties.class);
|
||||
|
||||
/**
|
||||
* nacos discovery server address
|
||||
*/
|
||||
@ -125,6 +142,11 @@ public class NacosDiscoveryProperties {
|
||||
@Autowired
|
||||
private InetUtils inetUtils;
|
||||
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
|
||||
private NamingService namingService;
|
||||
|
||||
@PostConstruct
|
||||
public void init() throws SocketException {
|
||||
|
||||
@ -163,6 +185,8 @@ public class NacosDiscoveryProperties {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
this.overrideFromEnv(environment);
|
||||
}
|
||||
|
||||
public String getEndpoint() {
|
||||
@ -333,4 +357,28 @@ public class NacosDiscoveryProperties {
|
||||
}
|
||||
}
|
||||
|
||||
public NamingService namingServiceInstance() {
|
||||
|
||||
if (null != namingService) {
|
||||
return namingService;
|
||||
}
|
||||
|
||||
Properties properties = new Properties();
|
||||
properties.put(SERVER_ADDR, serverAddr);
|
||||
properties.put(NAMESPACE, namespace);
|
||||
properties.put(UtilAndComs.NACOS_NAMING_LOG_NAME, logName);
|
||||
properties.put(ENDPOINT, endpoint);
|
||||
properties.put(ACCESS_KEY, accessKey);
|
||||
properties.put(SECRET_KEY, secretKey);
|
||||
properties.put(CLUSTER_NAME, clusterName);
|
||||
try {
|
||||
namingService = NacosFactory.createNamingService(properties);
|
||||
return namingService;
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOGGER.error("create naming service error!properties={},e=,", this, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.actuate.endpoint.AbstractEndpoint;
|
||||
import org.springframework.cloud.alibaba.nacos.NacosDiscoveryProperties;
|
||||
import org.springframework.cloud.alibaba.nacos.registry.NacosRegistration;
|
||||
|
||||
/**
|
||||
* Endpoint for nacos discovery, get nacos properties and subscribed services
|
||||
@ -43,9 +42,6 @@ public class NacosDiscoveryEndpoint extends AbstractEndpoint<Map<String, Object>
|
||||
@Autowired
|
||||
private NacosDiscoveryProperties nacosDiscoveryProperties;
|
||||
|
||||
@Autowired
|
||||
private NacosRegistration nacosRegistration;
|
||||
|
||||
public NacosDiscoveryEndpoint() {
|
||||
super("nacos_discovery", false);
|
||||
}
|
||||
@ -58,7 +54,7 @@ public class NacosDiscoveryEndpoint extends AbstractEndpoint<Map<String, Object>
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("NacosDiscoveryProperties", nacosDiscoveryProperties);
|
||||
|
||||
NamingService namingService = nacosRegistration.getNacosNamingService();
|
||||
NamingService namingService = nacosDiscoveryProperties.namingServiceInstance();
|
||||
List<ServiceInfo> subscribe = Collections.emptyList();
|
||||
|
||||
try {
|
||||
|
@ -26,7 +26,6 @@ import org.springframework.context.annotation.Configuration;
|
||||
* @author xiaojing
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnProperty(value = "spring.cloud.service-registry.auto-registration.enabled", matchIfMissing = true)
|
||||
@ConditionalOnClass(name = "org.springframework.boot.actuate.endpoint.AbstractEndpoint")
|
||||
public class NacosDiscoveryEndpointAutoConfiguration {
|
||||
|
||||
|
@ -28,15 +28,10 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import com.alibaba.nacos.api.NacosFactory;
|
||||
import com.alibaba.nacos.api.naming.NamingService;
|
||||
import com.alibaba.nacos.client.naming.utils.UtilAndComs;
|
||||
|
||||
import static com.alibaba.nacos.api.PropertyKeyConst.*;
|
||||
|
||||
/**
|
||||
* @author xiaojing
|
||||
@ -53,30 +48,10 @@ public class NacosRegistration implements Registration, ServiceInstance {
|
||||
@Autowired
|
||||
private ApplicationContext context;
|
||||
|
||||
private NamingService nacosNamingService;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
|
||||
Environment env = context.getEnvironment();
|
||||
nacosDiscoveryProperties.overrideFromEnv(context.getEnvironment());
|
||||
|
||||
Properties properties = new Properties();
|
||||
properties.put(SERVER_ADDR, nacosDiscoveryProperties.getServerAddr());
|
||||
properties.put(NAMESPACE, nacosDiscoveryProperties.getNamespace());
|
||||
properties.put(UtilAndComs.NACOS_NAMING_LOG_NAME,
|
||||
nacosDiscoveryProperties.getLogName());
|
||||
properties.put(ENDPOINT, nacosDiscoveryProperties.getEndpoint());
|
||||
properties.put(ACCESS_KEY, nacosDiscoveryProperties.getAccessKey());
|
||||
properties.put(SECRET_KEY, nacosDiscoveryProperties.getSecretKey());
|
||||
properties.put(CLUSTER_NAME, nacosDiscoveryProperties.getClusterName());
|
||||
try {
|
||||
nacosNamingService = NacosFactory.createNamingService(properties);
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
Integer managementPort = ManagementServerPortUtils.getPort(context);
|
||||
if (null != managementPort) {
|
||||
Map<String, String> metadata = nacosDiscoveryProperties.getMetadata();
|
||||
@ -143,11 +118,7 @@ public class NacosRegistration implements Registration, ServiceInstance {
|
||||
}
|
||||
|
||||
public NamingService getNacosNamingService() {
|
||||
return nacosNamingService;
|
||||
}
|
||||
|
||||
public void setNacosNamingService(NamingService nacosNamingService) {
|
||||
this.nacosNamingService = nacosNamingService;
|
||||
return nacosDiscoveryProperties.namingServiceInstance();
|
||||
}
|
||||
|
||||
public void setNacosDiscoveryProperties(
|
||||
@ -158,7 +129,6 @@ public class NacosRegistration implements Registration, ServiceInstance {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NacosRegistration{" + "nacosDiscoveryProperties="
|
||||
+ nacosDiscoveryProperties + ", nacosNamingService=" + nacosNamingService
|
||||
+ '}';
|
||||
+ nacosDiscoveryProperties + '}';
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,9 @@ package org.springframework.cloud.alibaba.nacos.ribbon;
|
||||
import com.netflix.client.config.IClientConfig;
|
||||
import com.netflix.loadbalancer.AbstractServerList;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.alibaba.nacos.NacosDiscoveryClient;
|
||||
import org.springframework.cloud.alibaba.nacos.registry.NacosRegistration;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -32,7 +34,7 @@ import com.alibaba.nacos.api.naming.pojo.Instance;
|
||||
public class NacosServerList extends AbstractServerList<NacosServer> {
|
||||
|
||||
@Autowired
|
||||
private NacosRegistration registration;
|
||||
private NacosDiscoveryClient discoveryClient;
|
||||
|
||||
private String serviceId;
|
||||
|
||||
@ -55,7 +57,7 @@ public class NacosServerList extends AbstractServerList<NacosServer> {
|
||||
|
||||
private List<NacosServer> getServers() {
|
||||
try {
|
||||
List<Instance> instances = registration.getNacosNamingService()
|
||||
List<Instance> instances = discoveryClient.getNamingService()
|
||||
.getAllInstances(serviceId);
|
||||
return instancesToServerList(instances);
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ public class NacosDiscoveryAutoConfigurationTests {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
this.context = new SpringApplicationBuilder(NacosDiscoveryTestConfiguration.class,
|
||||
NacosDiscoveryClientAutoConfiguration.class,
|
||||
NacosDiscoveryAutoConfiguration.class).web(false).run(
|
||||
"--spring.cloud.nacos.discovery.server-addr=127.0.0.1:8080",
|
||||
"--spring.cloud.nacos.discovery.port=18080",
|
||||
|
@ -9,6 +9,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.alibaba.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import org.springframework.cloud.alibaba.nacos.NacosDiscoveryClientAutoConfiguration;
|
||||
import org.springframework.cloud.alibaba.nacos.NacosDiscoveryProperties;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
||||
@ -33,6 +34,7 @@ public class NacosRibbonClientConfigurationTests {
|
||||
public void setUp() throws Exception {
|
||||
this.context = new SpringApplicationBuilder(NacosRibbonTestConfiguration.class,
|
||||
NacosDiscoveryAutoConfiguration.class,
|
||||
NacosDiscoveryClientAutoConfiguration.class,
|
||||
NacosRibbonClientConfiguration.class, RibbonNacosAutoConfiguration.class)
|
||||
.web(false).run("--server.port=18080",
|
||||
"--spring.cloud.nacos.discovery.server-addr=127.0.0.1:8080",
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-test</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-test</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
<name>Spring Cloud Starter Alibaba Nacos Config</name>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
<name>Spring Cloud Starter Alibaba Nacos Discovery</name>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
<name>Spring Cloud Starter Alibaba Sentinel</name>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-cloud-starter-alicloud</artifactId>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alicloud</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-starter-alicloud-oss</artifactId>
|
||||
<name>Spring Cloud Starter Alibaba Cloud OSS</name>
|
||||
|
Loading…
x
Reference in New Issue
Block a user