Skip to content

Commit aaf188c

Browse files
authored
[#1500] Add the spring-configuration-metadata.json file to provide automatic suggestions when set configurations in the configuration file. (#1506)
1 parent 0bbfaee commit aaf188c

File tree

5 files changed

+257
-0
lines changed

5 files changed

+257
-0
lines changed

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@
151151
<exclude>**/**.log</exclude>
152152
<!-- Skip the target files -->
153153
<exclude>**/target/**</exclude>
154+
<!-- Skip the spring-configuration-metadata files -->
155+
<exculde>**/resources/META-INF/*.json</exculde>
154156
</excludes>
155157
</configuration>
156158
</plugin>

spring-cloud-huawei-nacos/spring-cloud-huawei-nacos-config/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
<groupId>com.alibaba.spring</groupId>
4646
<artifactId>spring-context-support</artifactId>
4747
</dependency>
48+
<dependency>
49+
<groupId>org.springframework.boot</groupId>
50+
<artifactId>spring-boot-autoconfigure-processor</artifactId>
51+
<optional>true</optional>
52+
</dependency>
4853
<dependency>
4954
<groupId>org.springframework.boot</groupId>
5055
<artifactId>spring-boot-starter-actuator</artifactId>
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
{
2+
"properties": [
3+
{
4+
"name": "spring.cloud.nacos.config.server-addr",
5+
"type": "java.lang.String",
6+
"defaultValue": "127.0.0.1:8848",
7+
"description": "nacos config server address."
8+
},
9+
{
10+
"name": "spring.cloud.nacos.config.encode",
11+
"type": "java.lang.String",
12+
"defaultValue": "UTF-8",
13+
"description": "default encode for nacos config content."
14+
},
15+
{
16+
"name": "spring.cloud.nacos.config.prefix",
17+
"type": "java.lang.String",
18+
"defaultValue": "${spring.application.name}",
19+
"description": "the prefix of dataId, nacos config data meta info. dataId = prefix + '-' + ${spring.active.profile} + `.` + ${spring.cloud.nacos.config.file-extension}."
20+
},
21+
{
22+
"name": "spring.cloud.nacos.config.file-extension",
23+
"type": "java.lang.String",
24+
"defaultValue": "properties",
25+
"description": "the suffix of nacos config dataId, also the file extension of config content, only support properties now."
26+
},
27+
{
28+
"name": "spring.cloud.nacos.config.shared-dataids",
29+
"type": "java.lang.String",
30+
"description": "the dataids for configurable multiple shared configurations , multiple separated by commas ."
31+
},
32+
{
33+
"name": "spring.cloud.nacos.config.shared-configs",
34+
"type": "java.util.List",
35+
"description": "a set of shared configurations .e.g: spring.cloud.nacos.config.shared-configs[0]=xxx ."
36+
},
37+
{
38+
"name": "spring.cloud.nacos.config.extension-configs",
39+
"type": "java.util.List",
40+
"description": "a set of extensional configurations .e.g: spring.cloud.nacos.config.extension-configs[0]=xxx ."
41+
},
42+
{
43+
"name": "spring.cloud.nacos.config.refresh-enabled",
44+
"type": "java.lang.Boolean",
45+
"defaultValue": true,
46+
"description": "the master switch for refresh configuration, it default opened(true)."
47+
},
48+
{
49+
"name": "spring.cloud.nacos.config.enabled",
50+
"type": "java.lang.Boolean",
51+
"defaultValue": true,
52+
"description": "enable nacos config or not."
53+
},
54+
{
55+
"name": "spring.cloud.nacos.config.username",
56+
"type": "java.lang.String",
57+
"defaultValue": "${spring.nacos.username}",
58+
"description": "nacos config service's userName to authenticate."
59+
},
60+
{
61+
"name": "spring.cloud.nacos.config.import-check.enabled",
62+
"type": "java.lang.Boolean",
63+
"defaultValue": true,
64+
"description": "Whether to enable import-check."
65+
},
66+
{
67+
"name": "spring.cloud.nacos.config.password",
68+
"type": "java.lang.String",
69+
"defaultValue": "${spring.nacos.password}",
70+
"description": "nacos config service's password to authenticate."
71+
},
72+
{
73+
"name": "spring.cloud.nacos.config.username",
74+
"type": "java.lang.String",
75+
"description": "nacos userName to authenticate."
76+
},
77+
{
78+
"name": "spring.cloud.nacos.config.password",
79+
"type": "java.lang.String",
80+
"description": "nacos password to authenticate."
81+
},
82+
{
83+
"name": "spring.cloud.nacos.config.timeout",
84+
"type": "java.lang.Integer",
85+
"defaultValue": 3000,
86+
"description": "timeout for get config from nacos."
87+
},
88+
{
89+
"name": "spring.cloud.nacos.config.maxRetry",
90+
"type": "java.lang.String",
91+
"description": "nacos maximum number of tolerable server reconnection errors."
92+
},
93+
{
94+
"name": "spring.cloud.nacos.config.namespace",
95+
"type": "java.lang.String",
96+
"description": "separation configuration of different environments."
97+
},
98+
{
99+
"name": "spring.cloud.nacos.config.accessKey",
100+
"type": "java.lang.String",
101+
"description": "access key for namespace."
102+
},
103+
{
104+
"name": "spring.cloud.nacos.config.secretKey",
105+
"type": "java.lang.String",
106+
"description": "secret key for namespace."
107+
},
108+
{
109+
"name": "spring.cloud.nacos.config.group",
110+
"type": "java.lang.String",
111+
"defaultValue": "DEFAULT_GROUP",
112+
"description": "nacos config group, group is config data meta info."
113+
},
114+
{
115+
"name": "spring.cloud.nacos.config.name",
116+
"type": "java.lang.String",
117+
"description": "nacos config dataId name."
118+
},
119+
{
120+
"name": "spring.cloud.nacos.config.masterStandbyEnabled",
121+
"type": "java.lang.Boolean",
122+
"defaultValue": false,
123+
"description": "whether open master standby."
124+
},
125+
{
126+
"name": "spring.cloud.nacos.config.standbyServerAddr",
127+
"type": "java.lang.String",
128+
"description": "nacos standby node Address."
129+
},
130+
{
131+
"name": "spring.cloud.nacos.config.masterStandbyServerTaskDelay",
132+
"type": "java.lang.Lang",
133+
"defaultValue": 15000,
134+
"description": "nacos config center master standby node health check interval time."
135+
},
136+
{
137+
"name": "spring.cloud.nacos.config.retryMasterServerEnabled",
138+
"type": "java.lang.Boolean",
139+
"defaultValue": true,
140+
"description": "whether retry master node when the master node is isolated."
141+
}
142+
]
143+
}

spring-cloud-huawei-nacos/spring-cloud-huawei-nacos-discovery/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
<groupId>ch.qos.logback</groupId>
5151
<artifactId>logback-classic</artifactId>
5252
</dependency>
53+
<dependency>
54+
<groupId>org.springframework.boot</groupId>
55+
<artifactId>spring-boot-autoconfigure-processor</artifactId>
56+
<optional>true</optional>
57+
</dependency>
5358
</dependencies>
5459

5560
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
{
2+
"properties": [
3+
{
4+
"name": "spring.cloud.nacos.discovery.server-addr",
5+
"type": "java.lang.String",
6+
"defaultValue": "127.0.0.1:8848",
7+
"description": "nacos discovery server address."
8+
},
9+
{
10+
"name": "spring.cloud.nacos.discovery.service",
11+
"type": "java.lang.String",
12+
"defaultValue": "${spring.application.name}",
13+
"description": "the service name to register, default value is ${spring.application.name}."
14+
},
15+
{
16+
"name": "spring.cloud.nacos.discovery.enabled",
17+
"type": "java.lang.Boolean",
18+
"defaultValue": true,
19+
"description": "enable nacos discovery or not."
20+
},
21+
{
22+
"name": "spring.cloud.nacos.discovery.instance-enabled",
23+
"type": "java.lang.Boolean",
24+
"defaultValue": true,
25+
"description": "If instance is enabled to accept request. The default value is true."
26+
},
27+
{
28+
"name": "spring.cloud.nacos.discovery.ephemeral",
29+
"type": "java.lang.Boolean",
30+
"defaultValue": true,
31+
"description": "If instance is ephemeral.The default value is true."
32+
},
33+
{
34+
"name": "spring.cloud.nacos.discovery.watch.enabled",
35+
"type": "java.lang.Boolean",
36+
"defaultValue": "false",
37+
"description": "enable nacos discovery watch or not ."
38+
},
39+
{
40+
"name": "spring.cloud.nacos.discovery.heart-beat.enabled",
41+
"type": "java.lang.Boolean",
42+
"defaultValue": "false",
43+
"description": "enable nacos discovery heart beat or not ."
44+
},
45+
{
46+
"name": "spring.cloud.nacos.discovery.username",
47+
"type": "java.lang.String",
48+
"defaultValue": "${spring.cloud.nacos.username}",
49+
"description": "nacos discovery service's username to authenticate."
50+
},
51+
{
52+
"name": "spring.cloud.nacos.discovery.password",
53+
"type": "java.lang.String",
54+
"defaultValue": "${spring.cloud.nacos.password}",
55+
"description": "nacos discovery service's password to authenticate."
56+
},
57+
{
58+
"name": "spring.cloud.nacos.discovery.username",
59+
"type": "java.lang.String",
60+
"description": "nacos userName to authenticate."
61+
},
62+
{
63+
"name": "spring.cloud.nacos.discovery.password",
64+
"type": "java.lang.String",
65+
"description": "nacos password to authenticate."
66+
},
67+
{
68+
"name": "spring.cloud.nacos.discovery.ipType",
69+
"type": "java.lang.String",
70+
"defaultValue": "",
71+
"description": "microservice discovery ip type."
72+
},
73+
{
74+
"name": "spring.cloud.nacos.discovery.heartBeatTaskDelay",
75+
"type": "java.lang.Long",
76+
"defaultValue": 30000,
77+
"description": "microservice heartbeat interval."
78+
},
79+
{
80+
"name": "spring.cloud.nacos.discovery.networkInterface",
81+
"type": "java.lang.String",
82+
"description": "choose host NIC type."
83+
},
84+
{
85+
"name": "spring.cloud.nacos.discovery.masterStandbyEnabled",
86+
"type": "java.lang.Boolean",
87+
"defaultValue": false,
88+
"description": "whether open master standby."
89+
},
90+
{
91+
"name": "spring.cloud.nacos.discovery.standbyServerAddr",
92+
"type": "java.lang.String",
93+
"description": "nacos standby node Address."
94+
},
95+
{
96+
"name": "spring.cloud.nacos.discovery.namingServiceCheckTaskDelay",
97+
"type": "java.lang.Lang",
98+
"defaultValue": 5000,
99+
"description": "nacos service center master standby node health check interval time."
100+
}
101+
]
102+
}

0 commit comments

Comments
 (0)