From e66ea86f9846af22a50aa04c209106560e777695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BB=B6?= <1060026287@qq.com> Date: Sun, 20 Sep 2020 12:36:24 +0800 Subject: [PATCH 1/2] replace the way which get version --- .../alibaba/nacos/client/utils/ParamUtil.java | 16 ++-------------- client/src/main/resources/application.properties | 16 ---------------- 2 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 client/src/main/resources/application.properties diff --git a/client/src/main/java/com/alibaba/nacos/client/utils/ParamUtil.java b/client/src/main/java/com/alibaba/nacos/client/utils/ParamUtil.java index bbab5259362..b3c04043e67 100644 --- a/client/src/main/java/com/alibaba/nacos/client/utils/ParamUtil.java +++ b/client/src/main/java/com/alibaba/nacos/client/utils/ParamUtil.java @@ -20,9 +20,9 @@ import com.alibaba.nacos.api.SystemPropertyKeyConst; import com.alibaba.nacos.api.common.Constants; import com.alibaba.nacos.common.utils.StringUtils; +import com.alibaba.nacos.common.utils.VersionUtils; import org.slf4j.Logger; -import java.io.InputStream; import java.util.Properties; import java.util.concurrent.Callable; import java.util.regex.Pattern; @@ -80,19 +80,7 @@ public class ParamUtil { } LOGGER.info("[settings] [http-client] connect timeout:{}", connectTimeout); - try { - InputStream in = ValidatorUtils.class.getClassLoader().getResourceAsStream("application.properties"); - Properties props = new Properties(); - props.load(in); - String val = null; - val = props.getProperty("version"); - if (val != null) { - clientVersion = val; - } - LOGGER.info("NACOS_CLIENT_VERSION: {}", clientVersion); - } catch (Exception e) { - LOGGER.error("[500] read application.properties", e); - } + clientVersion = VersionUtils.version; try { perTaskConfigSize = Double.valueOf(System.getProperty("PER_TASK_CONFIG_SIZE", "3000")); diff --git a/client/src/main/resources/application.properties b/client/src/main/resources/application.properties deleted file mode 100644 index 0b368462815..00000000000 --- a/client/src/main/resources/application.properties +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright 1999-2018 Alibaba Group Holding Ltd. -# -# 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. -# -version=${project.version} From 2fe283471d499a117e2137d28cff1fe95df1d4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BB=B6?= <1060026287@qq.com> Date: Mon, 21 Sep 2020 12:38:16 +0800 Subject: [PATCH 2/2] remove version sign application.properties in nacos-api --- api/src/main/resources/application.properties | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 api/src/main/resources/application.properties diff --git a/api/src/main/resources/application.properties b/api/src/main/resources/application.properties deleted file mode 100644 index 0b368462815..00000000000 --- a/api/src/main/resources/application.properties +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright 1999-2018 Alibaba Group Holding Ltd. -# -# 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. -# -version=${project.version}