From 5939662df28a04aee27b0e4533ec7a7275f4b473 Mon Sep 17 00:00:00 2001 From: vdisk Date: Fri, 19 Feb 2021 11:13:17 +0800 Subject: [PATCH 1/3] spring-configuration-metadata --- apollo-client/pom.xml | 5 ++ ...itional-spring-configuration-metadata.json | 65 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 apollo-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json diff --git a/apollo-client/pom.xml b/apollo-client/pom.xml index 2bfcde34d18..2b877b690dc 100644 --- a/apollo-client/pom.xml +++ b/apollo-client/pom.xml @@ -63,6 +63,11 @@ spring-boot-autoconfigure true + + org.springframework.boot + spring-boot-configuration-processor + true + org.eclipse.jetty diff --git a/apollo-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/apollo-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 00000000000..362254c8937 --- /dev/null +++ b/apollo-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,65 @@ +{ + "properties": [ + { + "name": "apollo.accesskey.secret", + "type": "java.lang.String", + "sourceType": "com.ctrip.framework.foundation.internals.provider.DefaultApplicationProvider", + "description": "apollo client accessKey.", + "defaultValue": "" + }, + { + "name": "apollo.autoUpdateInjectedSpringProperties", + "type": "java.lang.Boolean", + "sourceType": "com.ctrip.framework.apollo.util.ConfigUtil", + "description": "auto update spring placeholder.", + "defaultValue": true + }, + { + "name": "apollo.bootstrap.enabled", + "type": "java.lang.Boolean", + "sourceType": "com.ctrip.framework.apollo.spring.config.PropertySourcesConstants", + "description": "enable inject namespace in bootstrap phase.", + "defaultValue": false + }, + { + "name": "apollo.bootstrap.namespaces", + "type": "java.lang.String", + "sourceType": "com.ctrip.framework.apollo.spring.config.PropertySourcesConstants", + "description": "injected namespaces split with ','.", + "defaultValue": "application" + }, + { + "name": "apollo.bootstrap.eagerLoad.enabled", + "type": "java.lang.Boolean", + "sourceType": "com.ctrip.framework.apollo.spring.config.PropertySourcesConstants", + "description": "enable apollo initialization before logging system initialization.", + "defaultValue": false + }, + { + "name": "apollo.cluster", + "type": "java.lang.String", + "sourceType": "com.ctrip.framework.apollo.core.ConfigConsts", + "description": "cluster name.", + "defaultValue": "default" + }, + { + "name": "apollo.meta", + "type": "java.net.URI", + "sourceType": "com.ctrip.framework.apollo.core.ConfigConsts", + "description": "apollo meta server address." + }, + { + "name": "apollo.property.order.enable", + "type": "java.lang.Boolean", + "sourceType": "com.ctrip.framework.apollo.util.factory.PropertiesFactory", + "description": "enable property order.", + "defaultValue": false + }, + { + "name": "app.id", + "type": "java.lang.String", + "sourceType": "com.ctrip.framework.foundation.spi.provider.ApplicationProvider", + "description": "apollo client app id. if it's empty apollo will only load public namespace configurations!." + } + ] +} From 354d75b2008aff7dd06b0148526c4bd22e033487 Mon Sep 17 00:00:00 2001 From: vdisk-group <62455066+vdisk-group@users.noreply.github.com> Date: Mon, 22 Feb 2021 09:41:34 +0800 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Jason Song --- .../additional-spring-configuration-metadata.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apollo-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/apollo-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 362254c8937..5787bd16f89 100644 --- a/apollo-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/apollo-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -4,28 +4,28 @@ "name": "apollo.accesskey.secret", "type": "java.lang.String", "sourceType": "com.ctrip.framework.foundation.internals.provider.DefaultApplicationProvider", - "description": "apollo client accessKey.", + "description": "apollo client access key.", "defaultValue": "" }, { "name": "apollo.autoUpdateInjectedSpringProperties", "type": "java.lang.Boolean", "sourceType": "com.ctrip.framework.apollo.util.ConfigUtil", - "description": "auto update spring placeholder.", + "description": "whether to auto update spring placeholder or not.", "defaultValue": true }, { "name": "apollo.bootstrap.enabled", "type": "java.lang.Boolean", "sourceType": "com.ctrip.framework.apollo.spring.config.PropertySourcesConstants", - "description": "enable inject namespace in bootstrap phase.", + "description": "enable injecting namespaces in bootstrap phase.", "defaultValue": false }, { "name": "apollo.bootstrap.namespaces", "type": "java.lang.String", "sourceType": "com.ctrip.framework.apollo.spring.config.PropertySourcesConstants", - "description": "injected namespaces split with ','.", + "description": "namespaces to be injected during bootstrap phase, multiple namespaces should be comma-separated.", "defaultValue": "application" }, { From c2c7354a993355e8e3a82c678c0111ec37ea55b8 Mon Sep 17 00:00:00 2001 From: vdisk Date: Mon, 22 Feb 2021 10:18:00 +0800 Subject: [PATCH 3/3] add apollo.cacheDir to metadata --- .../META-INF/additional-spring-configuration-metadata.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apollo-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/apollo-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 5787bd16f89..d0255acc4c9 100644 --- a/apollo-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/apollo-client/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -35,6 +35,13 @@ "description": "enable apollo initialization before logging system initialization.", "defaultValue": false }, + { + "name": "apollo.cacheDir", + "type": "java.lang.String", + "sourceType": "com.ctrip.framework.apollo.util.ConfigUtil", + "description": "local cache directory. the default value on windows is 'c:\\opt\\data', while on mac/linux is '/opt/data'.", + "defaultValue": "/opt/data" + }, { "name": "apollo.cluster", "type": "java.lang.String",