diff --git a/spring-cloud-alibaba-coverage/pom.xml b/spring-cloud-alibaba-coverage/pom.xml index 00132de97..816947103 100644 --- a/spring-cloud-alibaba-coverage/pom.xml +++ b/spring-cloud-alibaba-coverage/pom.xml @@ -51,11 +51,6 @@ spring-cloud-starter-alibaba-nacos-config ${revision} - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-config-server - ${revision} - com.alibaba.cloud diff --git a/spring-cloud-alibaba-dependencies/pom.xml b/spring-cloud-alibaba-dependencies/pom.xml index 059d85a87..6f5aead01 100644 --- a/spring-cloud-alibaba-dependencies/pom.xml +++ b/spring-cloud-alibaba-dependencies/pom.xml @@ -22,7 +22,6 @@ 1.8.4 1.5.1 2.1.0 - 0.8.0 1.0.11 @@ -45,7 +44,7 @@ com.alibaba.nacos nacos-config - ${nacos.config.version} + ${nacos.client.version} @@ -209,12 +208,6 @@ spring-cloud-starter-alibaba-nacos-config ${revision} - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-config-server - ${revision} - - com.alibaba.cloud spring-cloud-starter-stream-rocketmq diff --git a/spring-cloud-alibaba-starters/pom.xml b/spring-cloud-alibaba-starters/pom.xml index 3de738f41..0476ad963 100644 --- a/spring-cloud-alibaba-starters/pom.xml +++ b/spring-cloud-alibaba-starters/pom.xml @@ -16,7 +16,6 @@ spring-cloud-starter-alibaba-nacos-config - spring-cloud-starter-alibaba-nacos-config-server spring-cloud-starter-alibaba-nacos-discovery spring-cloud-starter-alibaba-seata spring-cloud-starter-stream-rocketmq diff --git a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/pom.xml b/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/pom.xml deleted file mode 100644 index 64ece752a..000000000 --- a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ - - 4.0.0 - - - com.alibaba.cloud - spring-cloud-alibaba-starters - ${revision} - ../pom.xml - - - spring-cloud-starter-alibaba-nacos-config-server - Spring Cloud Starter Alibaba Nacos Config Server - - - - - - com.alibaba.nacos - nacos-config - - - - - org.springframework.cloud - spring-cloud-config-server - - - - - org.springframework.boot - spring-boot-starter - true - - - - org.springframework.boot - spring-boot-starter-actuator - true - - - - org.springframework.boot - spring-boot-configuration-processor - true - - - - org.springframework.boot - spring-boot-starter-test - test - - - - diff --git a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/main/java/com/alibaba/cloud/nacos/config/server/NacosConfigServerAutoConfiguration.java b/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/main/java/com/alibaba/cloud/nacos/config/server/NacosConfigServerAutoConfiguration.java deleted file mode 100644 index acf966a50..000000000 --- a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/main/java/com/alibaba/cloud/nacos/config/server/NacosConfigServerAutoConfiguration.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2013-2018 the original author or authors. - * - * 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 - * - * https://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. - */ - -package com.alibaba.cloud.nacos.config.server; - -import com.alibaba.cloud.nacos.config.server.environment.NacosEnvironmentRepository; - -import org.springframework.boot.autoconfigure.AutoConfigureBefore; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.cloud.config.server.EnableConfigServer; -import org.springframework.cloud.config.server.config.ConfigServerAutoConfiguration; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; - -/** - * Nacos Config Server Auto-Configuration. - * - * @author Mercy - * @since 0.2.0 - */ -@ConditionalOnClass(EnableConfigServer.class) // If class of @EnableConfigServer is - // present in class-path -@ComponentScan(basePackages = { "com.alibaba.nacos.config.server" }) -@AutoConfigureBefore(ConfigServerAutoConfiguration.class) -@Configuration(proxyBeanMethods = false) -public class NacosConfigServerAutoConfiguration { - - @Bean - public NacosEnvironmentRepository nacosEnvironmentRepository() { - return new NacosEnvironmentRepository(); - } - -} diff --git a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/main/java/com/alibaba/cloud/nacos/config/server/environment/NacosEnvironmentRepository.java b/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/main/java/com/alibaba/cloud/nacos/config/server/environment/NacosEnvironmentRepository.java deleted file mode 100644 index 66fb2dfd8..000000000 --- a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/main/java/com/alibaba/cloud/nacos/config/server/environment/NacosEnvironmentRepository.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2013-2018 the original author or authors. - * - * 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 - * - * https://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. - */ - -package com.alibaba.cloud.nacos.config.server.environment; - -import java.io.IOException; -import java.io.StringReader; -import java.util.Properties; - -import com.alibaba.nacos.config.server.model.ConfigInfo; -import com.alibaba.nacos.config.server.service.PersistService; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cloud.config.environment.Environment; -import org.springframework.cloud.config.environment.PropertySource; -import org.springframework.cloud.config.server.environment.EnvironmentRepository; -import org.springframework.util.StringUtils; - -import static com.alibaba.nacos.config.server.constant.Constants.DEFAULT_GROUP; - -/** - * Nacos {@link EnvironmentRepository}. - * - * @author Mercy - * @since 0.2.0 - */ -public class NacosEnvironmentRepository implements EnvironmentRepository { - - @Autowired - private PersistService persistService; - - @Override - public Environment findOne(String application, String profile, String label) { - - String dataId = application + "-" + profile + ".properties"; - - ConfigInfo configInfo = persistService.findConfigInfo(dataId, DEFAULT_GROUP, - label); - - return createEnvironment(configInfo, application, profile); - } - - private Environment createEnvironment(ConfigInfo configInfo, String application, - String profile) { - - Environment environment = new Environment(application, profile); - - Properties properties = createProperties(configInfo); - - String propertySourceName = String - .format("Nacos[application : %s , profile : %s]", application, profile); - - PropertySource propertySource = new PropertySource(propertySourceName, - properties); - - environment.add(propertySource); - - return environment; - } - - private Properties createProperties(ConfigInfo configInfo) { - Properties properties = new Properties(); - String content = configInfo == null ? null : configInfo.getContent(); - if (StringUtils.hasText(content)) { - try { - properties.load(new StringReader(content)); - } - catch (IOException e) { - throw new IllegalStateException("The format of content is a properties"); - } - } - return properties; - } - - private static String[] of(String... values) { - return values; - } - -} diff --git a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/main/resources/META-INF/spring.factories b/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/main/resources/META-INF/spring.factories deleted file mode 100644 index aef71745a..000000000 --- a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,3 +0,0 @@ -# Auto-Configuration -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -com.alibaba.cloud.nacos.config.server.NacosConfigServerAutoConfiguration \ No newline at end of file diff --git a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/test/java/com/alibaba/cloud/nacos/config/server/bootstrap/NacosConfigServerBootstrap.java b/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/test/java/com/alibaba/cloud/nacos/config/server/bootstrap/NacosConfigServerBootstrap.java deleted file mode 100644 index cba01073f..000000000 --- a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/test/java/com/alibaba/cloud/nacos/config/server/bootstrap/NacosConfigServerBootstrap.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2013-2018 the original author or authors. - * - * 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 - * - * https://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. - */ - -package com.alibaba.cloud.nacos.config.server.bootstrap; - -import org.springframework.boot.ApplicationRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.cloud.config.server.EnableConfigServer; -import org.springframework.context.annotation.Bean; - -/** - * Nacos Config Server Bootstrap. - * - * @author Mercy - * @since 0.2.0 - */ -@EnableAutoConfiguration -@EnableConfigServer -public class NacosConfigServerBootstrap { - - public static void main(String[] args) { - System.setProperty("nacos.standalone", "true"); - SpringApplication.run(NacosConfigServerBootstrap.class); - } - - @Bean - public ApplicationRunner applicationRunner() { - - return args -> { - System.out.println("Running..."); - }; - } - -} diff --git a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/test/resources/application.properties b/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/test/resources/application.properties deleted file mode 100644 index 7121d6310..000000000 --- a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config-server/src/test/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -spring.application.name=nacos-config-server -management.endpoints.web.exposure.include=*