فهرست منبع

refactor: remove app.properties and move some config file's location (#4637)

* refactor(apollo-common): delete application-github.properties

* Delete app.properties

* refactor(apollo-configservice): config in assembly

* Delete app.properties

* refactor(apollo-adminservice): config in assembly

* Delete app.properties

* refactor(apollo-portal): config in assembly

* delete META-INF/app.properties

* delete resource src/main/config

* docs: fix path from src/main/config to src/main/resources

* Update CHANGES.md

* remove api of "app"
wxq 2 سال پیش
والد
کامیت
dc3067b6e2
26فایلهای تغییر یافته به همراه12 افزوده شده و 194 حذف شده
  1. 1 0
      CHANGES.md
  2. 1 10
      apollo-adminservice/src/assembly/assembly-descriptor.xml
  3. 0 17
      apollo-adminservice/src/main/config/app.properties
  4. 0 17
      apollo-adminservice/src/main/resources/META-INF/app.properties
  5. 0 0
      apollo-adminservice/src/main/resources/apollo-adminservice.conf
  6. 0 0
      apollo-adminservice/src/main/resources/application-github.properties
  7. 0 17
      apollo-assembly/src/main/resources/META-INF/app.properties
  8. 0 5
      apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/ApolloInfoController.java
  9. 1 10
      apollo-configservice/src/assembly/assembly-descriptor.xml
  10. 0 17
      apollo-configservice/src/main/config/app.properties
  11. 0 17
      apollo-configservice/src/main/resources/META-INF/app.properties
  12. 0 0
      apollo-configservice/src/main/resources/apollo-configservice.conf
  13. 0 0
      apollo-configservice/src/main/resources/application-github.properties
  14. 1 9
      apollo-portal/src/assembly/assembly-descriptor.xml
  15. 0 17
      apollo-portal/src/main/config/app.properties
  16. 0 19
      apollo-portal/src/main/config/application-github.properties
  17. 0 17
      apollo-portal/src/main/resources/META-INF/app.properties
  18. 0 0
      apollo-portal/src/main/resources/apollo-portal.conf
  19. 0 0
      apollo-portal/src/main/resources/application-github.properties
  20. 0 0
      apollo-portal/src/main/resources/application-ldap-activedirectory-sample.yml
  21. 0 0
      apollo-portal/src/main/resources/application-ldap-apacheds-sample.yml
  22. 0 0
      apollo-portal/src/main/resources/application-ldap-openldap-sample.yml
  23. 0 0
      apollo-portal/src/main/resources/application-oidc-sample.yml
  24. 4 4
      docs/en/development/portal-how-to-implement-user-login-function.md
  25. 4 4
      docs/zh/development/portal-how-to-implement-user-login-function.md
  26. 0 14
      pom.xml

+ 1 - 0
CHANGES.md

@@ -37,6 +37,7 @@ Apollo 2.1.0
 * [fix doc bug](https://github.com/apolloconfig/apollo/pull/4579)
 * [fix Grayscale release Item Value length limit can not be synchronized with its main version](https://github.com/apolloconfig/apollo/pull/4622)
 * [feat: use can change spring.profiles.active's value without rebuild project](https://github.com/apolloconfig/apollo/pull/4616)
+* [refactor: remove app.properties and move some config file's location](https://github.com/apolloconfig/apollo/pull/4637)
 
 ------------------
 All issues and pull requests are [here](https://github.com/apolloconfig/apollo/milestone/11?closed=1)

+ 1 - 10
apollo-adminservice/src/assembly/assembly-descriptor.xml

@@ -35,16 +35,7 @@
 			<lineEnding>unix</lineEnding>
 		</fileSet>
 		<fileSet>
-			<directory>src/main/config</directory>
-			<outputDirectory>config</outputDirectory>
-			<excludes>
-				<exclude>apollo-adminservice.conf</exclude>
-				<exclude>application-github.properties</exclude>
-			</excludes>
-			<lineEnding>unix</lineEnding>
-		</fileSet>
-		<fileSet>
-			<directory>src/main/config</directory>
+			<directory>target/classes</directory>
 			<outputDirectory>/</outputDirectory>
 			<includes>
 				<include>apollo-adminservice.conf</include>

+ 0 - 17
apollo-adminservice/src/main/config/app.properties

@@ -1,17 +0,0 @@
-#
-# Copyright 2022 Apollo 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
-#
-# http://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.
-#
-appId=100003172
-jdkVersion=1.8

+ 0 - 17
apollo-adminservice/src/main/resources/META-INF/app.properties

@@ -1,17 +0,0 @@
-#
-# Copyright 2022 Apollo 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
-#
-# http://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.
-#
-app.id=100003172
-jdkVersion=1.8

+ 0 - 0
apollo-adminservice/src/main/config/apollo-adminservice.conf → apollo-adminservice/src/main/resources/apollo-adminservice.conf


+ 0 - 0
apollo-adminservice/src/main/config/application-github.properties → apollo-adminservice/src/main/resources/application-github.properties


+ 0 - 17
apollo-assembly/src/main/resources/META-INF/app.properties

@@ -1,17 +0,0 @@
-#
-# Copyright 2022 Apollo 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
-#
-# http://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.
-#
-app.id=100003171
-jdkVersion=1.8

+ 0 - 5
apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/ApolloInfoController.java

@@ -26,11 +26,6 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping(path = "/apollo")
 public class ApolloInfoController {
 
-  @RequestMapping("app")
-  public String getApp() {
-    return Foundation.app().toString();
-  }
-
   @RequestMapping("net")
   public String getNet() {
     return Foundation.net().toString();

+ 1 - 10
apollo-configservice/src/assembly/assembly-descriptor.xml

@@ -35,16 +35,7 @@
 			<lineEnding>unix</lineEnding>
 		</fileSet>
 		<fileSet>
-			<directory>src/main/config</directory>
-			<outputDirectory>config</outputDirectory>
-			<excludes>
-				<exclude>apollo-configservice.conf</exclude>
-				<exclude>application-github.properties</exclude>
-			</excludes>
-			<lineEnding>unix</lineEnding>
-		</fileSet>
-		<fileSet>
-			<directory>src/main/config</directory>
+			<directory>target/classes</directory>
 			<outputDirectory>/</outputDirectory>
 			<includes>
 				<include>apollo-configservice.conf</include>

+ 0 - 17
apollo-configservice/src/main/config/app.properties

@@ -1,17 +0,0 @@
-#
-# Copyright 2022 Apollo 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
-#
-# http://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.
-#
-appId=100003171
-jdkVersion=1.8

+ 0 - 17
apollo-configservice/src/main/resources/META-INF/app.properties

@@ -1,17 +0,0 @@
-#
-# Copyright 2022 Apollo 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
-#
-# http://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.
-#
-app.id=100003171
-jdkVersion=1.8

+ 0 - 0
apollo-configservice/src/main/config/apollo-configservice.conf → apollo-configservice/src/main/resources/apollo-configservice.conf


+ 0 - 0
apollo-common/src/main/resources/application-github.properties → apollo-configservice/src/main/resources/application-github.properties


+ 1 - 9
apollo-portal/src/assembly/assembly-descriptor.xml

@@ -35,15 +35,7 @@
 			<lineEnding>unix</lineEnding>
 		</fileSet>
 		<fileSet>
-			<directory>src/main/config</directory>
-			<outputDirectory>config</outputDirectory>
-			<includes>
-				<include>app.properties</include>
-			</includes>
-			<lineEnding>unix</lineEnding>
-		</fileSet>
-		<fileSet>
-			<directory>src/main/config</directory>
+			<directory>target/classes</directory>
 			<outputDirectory>/</outputDirectory>
 			<includes>
 				<include>apollo-portal.conf</include>

+ 0 - 17
apollo-portal/src/main/config/app.properties

@@ -1,17 +0,0 @@
-#
-# Copyright 2022 Apollo 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
-#
-# http://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.
-#
-appId=100003173
-jdkVersion=1.8

+ 0 - 19
apollo-portal/src/main/config/application-github.properties

@@ -1,19 +0,0 @@
-#
-# Copyright 2022 Apollo 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
-#
-# http://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.
-#
-# DataSource
-spring.datasource.url = ${spring_datasource_url}
-spring.datasource.username = ${spring_datasource_username}
-spring.datasource.password = ${spring_datasource_password}

+ 0 - 17
apollo-portal/src/main/resources/META-INF/app.properties

@@ -1,17 +0,0 @@
-#
-# Copyright 2022 Apollo 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
-#
-# http://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.
-#
-app.id=100003173
-jdkVersion=1.8

+ 0 - 0
apollo-portal/src/main/config/apollo-portal.conf → apollo-portal/src/main/resources/apollo-portal.conf


+ 0 - 0
apollo-configservice/src/main/config/application-github.properties → apollo-portal/src/main/resources/application-github.properties


+ 0 - 0
apollo-portal/src/main/config/application-ldap-activedirectory-sample.yml → apollo-portal/src/main/resources/application-ldap-activedirectory-sample.yml


+ 0 - 0
apollo-portal/src/main/config/application-ldap-apacheds-sample.yml → apollo-portal/src/main/resources/application-ldap-apacheds-sample.yml


+ 0 - 0
apollo-portal/src/main/config/application-ldap-openldap-sample.yml → apollo-portal/src/main/resources/application-ldap-openldap-sample.yml


+ 0 - 0
apollo-portal/src/main/config/application-oidc-sample.yml → apollo-portal/src/main/resources/application-oidc-sample.yml


+ 4 - 4
docs/en/development/portal-how-to-implement-user-login-function.md

@@ -40,7 +40,7 @@ Starting from version 1.2.0, Apollo supports ldap protocol login, which can be c
 
 #### 1.1 Configure `application-ldap.yml`
 
-After unpacking `apollo-portal-x.x.x-github.zip`, create `application-ldap.yml` in the `config` directory with the following reference ([sample](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/config/application-ldap-openldap-sample.yml)) , the relevant content needs to be adjusted according to the specific situation: 
+After unpacking `apollo-portal-x.x.x-github.zip`, create `application-ldap.yml` in the `config` directory with the following reference ([sample](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/resources/application-ldap-openldap-sample.yml)) , the relevant content needs to be adjusted according to the specific situation: 
 
 ```yml
 spring:
@@ -130,7 +130,7 @@ export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap"
 
 #### 2.1 Configure `application-ldap.yml`
 
-After unpacking `apollo-portal-x.x.x-github.zip`, create `application-ldap.yml` in the `config` directory with the following reference ([sample](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/config/application-ldap-activedirectory-sample.yml)) , the relevant content needs to be adapted to the specific case: 
+After unpacking `apollo-portal-x.x.x-github.zip`, create `application-ldap.yml` in the `config` directory with the following reference ([sample](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/resources/application-ldap-activedirectory-sample.yml)) , the relevant content needs to be adapted to the specific case: 
 
 ```yml
 spring:
@@ -170,7 +170,7 @@ export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap"
 
 #### 3.1 Configure `application-ldap.yml`
 
-After unpacking `apollo-portal-x.x.x-github.zip`, create `application-ldap.yml` in the `config` directory with the following reference ([sample](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/config/application-ldap-apacheds-sample.yml)) , the relevant content needs to be adjusted according to the specific situation: 
+After unpacking `apollo-portal-x.x.x-github.zip`, create `application-ldap.yml` in the `config` directory with the following reference ([sample](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/resources/application-ldap-apacheds-sample.yml)) , the relevant content needs to be adjusted according to the specific situation: 
 
 ```yml
 spring:
@@ -242,7 +242,7 @@ Before configuration, you need to prepare:
 
 ### 1. Configure `application-oidc.yml`
 
-After unpacking `apollo-portal-x.x.x-github.zip`, create `application-oidc.yml` in the `config` directory with the following contents ([sample](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/config/application-oidc-sample.yml)) , the relevant content needs to be adapted to the specific case:
+After unpacking `apollo-portal-x.x.x-github.zip`, create `application-oidc.yml` in the `config` directory with the following contents ([sample](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/resources/application-oidc-sample.yml)) , the relevant content needs to be adapted to the specific case:
 
 #### 1.1 Minimum configuration
 

+ 4 - 4
docs/zh/development/portal-how-to-implement-user-login-function.md

@@ -36,7 +36,7 @@ Apollo是配置管理系统,会提供权限管理(Authorization),理论
 
 #### 1.1 配置`application-ldap.yml`
 
-解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/config/application-ldap-openldap-sample.yml)),相关的内容需要按照具体情况调整:
+解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/resources/application-ldap-openldap-sample.yml)),相关的内容需要按照具体情况调整:
 
 ```yml
 spring:
@@ -126,7 +126,7 @@ export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap"
 
 #### 2.1 配置`application-ldap.yml`
 
-解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/config/application-ldap-activedirectory-sample.yml)),相关的内容需要按照具体情况调整:
+解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/resources/application-ldap-activedirectory-sample.yml)),相关的内容需要按照具体情况调整:
 
 ```yml
 spring:
@@ -166,7 +166,7 @@ export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap"
 
 #### 3.1 配置`application-ldap.yml`
 
-解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/config/application-ldap-apacheds-sample.yml)),相关的内容需要按照具体情况调整:
+解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-ldap.yml`,内容参考如下([样例](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/resources/application-ldap-apacheds-sample.yml)),相关的内容需要按照具体情况调整:
 
 ```yml
 spring:
@@ -236,7 +236,7 @@ export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=github,ldap"
 
 ### 1. 配置 `application-oidc.yml`
 
-解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-oidc.yml`,内容参考如下([样例](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/config/application-oidc-sample.yml)),相关的内容需要按照具体情况调整:
+解压`apollo-portal-x.x.x-github.zip`后,在`config`目录下创建`application-oidc.yml`,内容参考如下([样例](https://github.com/apolloconfig/apollo/blob/master/apollo-portal/src/main/resources/application-oidc-sample.yml)),相关的内容需要按照具体情况调整:
 
 #### 1.1 最小配置
 

+ 0 - 14
pom.xml

@@ -581,20 +581,6 @@
 					<exclude>**/*.xml</exclude>
 				</excludes>
 			</resource>
-			<resource>
-				<directory>src/main/config</directory>
-				<filtering>true</filtering>
-				<includes>
-					<include>application-github.properties</include>
-				</includes>
-			</resource>
-			<resource>
-				<directory>src/main/config</directory>
-				<filtering>false</filtering>
-				<excludes>
-					<exclude>application-github.properties</exclude>
-				</excludes>
-			</resource>
 		</resources>
 	</build>
 	<profiles>