diff --git a/spring-cloud-alibaba-examples/acm-example/acm-local-example/src/main/resources/bootstrap.properties b/spring-cloud-alibaba-examples/acm-example/acm-local-example/src/main/resources/bootstrap.properties index dceeba95a..448a0c7dd 100644 --- a/spring-cloud-alibaba-examples/acm-example/acm-local-example/src/main/resources/bootstrap.properties +++ b/spring-cloud-alibaba-examples/acm-example/acm-local-example/src/main/resources/bootstrap.properties @@ -2,5 +2,4 @@ spring.application.group=com.alibaba.acm spring.application.name=acm-local server.port=18089 spring.cloud.alicloud.acm.server-list=127.0.0.1 -spring.cloud.alicloud.acm.server-port=8080 - +spring.cloud.alicloud.acm.server-port=8080 \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/readme-zh.md b/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/readme-zh.md index bef4f89d1..b9ec18f02 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/readme-zh.md +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/readme-zh.md @@ -118,9 +118,9 @@ Nacos Client 从 Nacos Server 端获取数据时,调用的是此接口 `Config * `spring.active.profile` 即为当前环境对应的 profile,详情可以参考 [Spring Boot文档](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-profiles.html#boot-features-profiles) - **注意,当 activeprofile 为空时,对应的连接符 `-` 也将不存在,dataId 的拼接格式变成 `${prefix}`.`${context.type}`** + **注意,当 activeprofile 为空时,对应的连接符 `-` 也将不存在,dataId 的拼接格式变成 `${prefix}`.`${file-extension}`** -* `file-extension` 为配置内容的数据格式,可以通过配置项 `spring.cloud.nacos.config.content-type`来配置。 +* `file-extension` 为配置内容的数据格式,可以通过配置项 `spring.cloud.nacos.config.file-extension`来配置。 目前只支持 `properties` 类型。 #### group @@ -168,7 +168,7 @@ Spring Boot 2.x 可以通过访问 http://127.0.0.1:18084/actuator/nacos-config 服务端地址|spring.cloud.nacos.config.server-addr|| DataId前缀|spring.cloud.nacos.config.prefix||spring.application.name Group|spring.cloud.nacos.config.group|DEFAULT_GROUP| -dataID后缀及数据格式|spring.cloud.nacos.config.file-extension|properties|目前只支持 properties +dataID后缀及内容文件格式|spring.cloud.nacos.config.file-extension|properties|dataId的后缀,同时也是配置内容的文件格式,目前只支持 properties 配置内容的编码方式|spring.cloud.nacos.config.encode|UTF-8|配置的编码 获取配置的超时时间|spring.cloud.nacos.config.timeout|3000|单位为 ms 配置的命名空间|spring.cloud.nacos.config.namespace||常用场景之一是不同环境的配置的区分隔离,例如开发测试环境和生产环境的资源隔离等。 diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/readme.md b/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/readme.md index 05bda7fc7..a2f8f3e8f 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/readme.md +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-config-example/readme.md @@ -119,9 +119,9 @@ In Nacos Config Starter, the splicing format of dataId is as follows * `spring.active.profile` is the profile corresponding to the current environment. For details, please refer to [Spring Boot Doc](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-profiles.html#boot-features-profiles) - **Note: when the activeprofile is empty, the corresponding connector `-` will also not exist, and the splicing format of the dataId becomes `${prefix}`.`${context.type}`** + **Note: when the activeprofile is empty, the corresponding connector `-` will also not exist, and the splicing format of the dataId becomes `${prefix}`.`${file-extension}`** -* `file-extension` is the data format of the configuration content, which can be configured by the configuration item `spring.cloud.nacos.config.content-type`. +* `file-extension` is the data format of the configuration content, which can be configured by the configuration item `spring.cloud.nacos.config.file-extension`. Currently only the `properties` type is supported. #### group diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/readme-zh.md b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/readme-zh.md index a04451d36..47b431792 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/readme-zh.md +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/readme-zh.md @@ -197,7 +197,7 @@ AccessKey|spring.cloud.nacos.discovery.access-key|| SecretKey|spring.cloud.nacos.discovery.secret-key|| Metadata|spring.cloud.nacos.discovery.metadata||使用Map格式配置 日志文件名|spring.cloud.nacos.discovery.log-name|| -接入点|spring.cloud.nacos.discovery.enpoint|UTF-8|地域的某个服务的入口域名,通过此域名可以动态地拿到服务端地址 +接入点|spring.cloud.nacos.discovery.endpoint|UTF-8|地域的某个服务的入口域名,通过此域名可以动态地拿到服务端地址 是否集成Ribbon|ribbon.nacos.enabled|true| diff --git a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/readme.md b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/readme.md index cd26ef587..da81f49b7 100644 --- a/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/readme.md +++ b/spring-cloud-alibaba-examples/nacos-example/nacos-discovery-example/readme.md @@ -205,7 +205,7 @@ AccessKey|spring.cloud.nacos.discovery.access-key|| SecretKey|spring.cloud.nacos.discovery.secret-key|| Metadata|spring.cloud.nacos.discovery.metadata||Extended data, Configure using Map format log name|spring.cloud.nacos.discovery.log-name|| -endpoint|spring.cloud.nacos.discovery.enpoint||The domain name of a service, through which the server address can be dynamically obtained. +endpoint|spring.cloud.nacos.discovery.endpoint||The domain name of a service, through which the server address can be dynamically obtained. Integration Ribbon|ribbon.nacos.enabled|true| diff --git a/spring-cloud-alibaba-nacos-config/src/main/java/org/springframework/cloud/alibaba/nacos/client/NacosPropertySourceBuilder.java b/spring-cloud-alibaba-nacos-config/src/main/java/org/springframework/cloud/alibaba/nacos/client/NacosPropertySourceBuilder.java index 4e5d63b67..16bf97d09 100644 --- a/spring-cloud-alibaba-nacos-config/src/main/java/org/springframework/cloud/alibaba/nacos/client/NacosPropertySourceBuilder.java +++ b/spring-cloud-alibaba-nacos-config/src/main/java/org/springframework/cloud/alibaba/nacos/client/NacosPropertySourceBuilder.java @@ -83,7 +83,6 @@ public class NacosPropertySourceBuilder { String data = null; try { data = configService.getConfig(dataId, group, timeout); - // todo add content type yaml support if (!StringUtils.isEmpty(data)) { logger.info(String.format("Loading nacos data, dataId: '%s', group: '%s'", dataId, group)); @@ -95,7 +94,7 @@ public class NacosPropertySourceBuilder { return properties; } else if (fileExtension.equalsIgnoreCase("yaml") - || fileExtension.equalsIgnoreCase("yml")) { + || fileExtension.equalsIgnoreCase("yml")) { YamlPropertiesFactoryBean yamlFactory = new YamlPropertiesFactoryBean(); yamlFactory.setResources(new ByteArrayResource(data.getBytes())); return yamlFactory.getObject(); diff --git a/spring-cloud-alicloud-context/pom.xml b/spring-cloud-alicloud-context/pom.xml index 0084d0910..e7cbf206e 100644 --- a/spring-cloud-alicloud-context/pom.xml +++ b/spring-cloud-alicloud-context/pom.xml @@ -82,6 +82,13 @@ true + + org.springframework.boot + spring-boot-configuration-processor + provided + true + + org.springframework.boot spring-boot-starter-test diff --git a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/AliCloudSpringApplicationTests.java b/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/AliCloudSpringApplicationTests.java index b40edd268..636adf64e 100644 --- a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/AliCloudSpringApplicationTests.java +++ b/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/AliCloudSpringApplicationTests.java @@ -29,7 +29,7 @@ import org.springframework.test.context.junit4.SpringRunner; * @author xiaolongzuo */ @RunWith(SpringRunner.class) -@SpringBootTest(classes = AliCloudSpringApplicationTests.EurekaClientDisabledApp.class, properties = { +@SpringBootTest(classes = AliCloudSpringApplicationTests.AliCloudDisabledApp.class, properties = { "spring.application.name=myapp", "spring.cloud.alicloud.edas.application.name=myapp", "spring.cloud.alicloud.access-key=ak", "spring.cloud.alicloud.secret-key=sk", @@ -43,7 +43,7 @@ public class AliCloudSpringApplicationTests { } @SpringBootApplication - public static class EurekaClientDisabledApp { + public static class AliCloudDisabledApp { }