From 2e667b1ff46ae31b4769bdb56830ab0ee5c358d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= Date: Fri, 19 Apr 2019 10:53:20 +0800 Subject: [PATCH] =?UTF-8?q?:loud=5Fsound:=20=E6=97=A5=E5=BF=97=E7=BA=A7?= =?UTF-8?q?=E5=88=AB=E4=BF=AE=E6=94=B9=E3=80=81=E9=85=8D=E7=BD=AE=E5=90=8D?= =?UTF-8?q?=20=E5=B8=B8=E9=87=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/logback-spring.xml | 2 +- .../alibaba/nacos/PigxNacosApplication.java | 10 +++---- .../nacos/console/config/ConfigConstant.java | 27 +++++++++++++++++++ 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 pigx-register/src/main/java/com/alibaba/nacos/console/config/ConfigConstant.java diff --git a/pigx-common/pigx-common-core/src/main/resources/logback-spring.xml b/pigx-common/pigx-common-core/src/main/resources/logback-spring.xml index eb1721e59..afba91f2a 100644 --- a/pigx-common/pigx-common-core/src/main/resources/logback-spring.xml +++ b/pigx-common/pigx-common-core/src/main/resources/logback-spring.xml @@ -52,7 +52,7 @@ - + diff --git a/pigx-register/src/main/java/com/alibaba/nacos/PigxNacosApplication.java b/pigx-register/src/main/java/com/alibaba/nacos/PigxNacosApplication.java index f125fbfda..9b257f589 100755 --- a/pigx-register/src/main/java/com/alibaba/nacos/PigxNacosApplication.java +++ b/pigx-register/src/main/java/com/alibaba/nacos/PigxNacosApplication.java @@ -16,7 +16,7 @@ package com.alibaba.nacos; -import com.alibaba.nacos.core.utils.Constants; +import com.alibaba.nacos.console.config.ConfigConstant; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.scheduling.annotation.EnableScheduling; @@ -32,10 +32,10 @@ import org.springframework.scheduling.annotation.EnableScheduling; public class PigxNacosApplication { public static void main(String[] args) { - System.setProperty("server.tomcat.basedir", "logs"); - System.setProperty("nacos.home", "pigx-config"); - System.setProperty("user.home", "logs"); - System.setProperty(Constants.STANDALONE_MODE_PROPERTY_NAME, "true"); + System.setProperty(ConfigConstant.TOMCAT_DIR, "logs"); + System.setProperty(ConfigConstant.NACOS_HOME, "pigx-config"); + System.setProperty(ConfigConstant.USER_HOME, "logs"); + System.setProperty(ConfigConstant.STANDALONE_MODE, "true"); SpringApplication.run(PigxNacosApplication.class, args); } } diff --git a/pigx-register/src/main/java/com/alibaba/nacos/console/config/ConfigConstant.java b/pigx-register/src/main/java/com/alibaba/nacos/console/config/ConfigConstant.java new file mode 100644 index 000000000..0b8977412 --- /dev/null +++ b/pigx-register/src/main/java/com/alibaba/nacos/console/config/ConfigConstant.java @@ -0,0 +1,27 @@ +package com.alibaba.nacos.console.config; + +/** + * @author lengleng + * @date 2019-04-19 + */ +public interface ConfigConstant { + /** + * The System property name of Standalone mode + */ + String STANDALONE_MODE = "nacos.standalone"; + + /** + * 环境变量 + */ + String USER_HOME = "user.home"; + + /** + * nacos 家目录 + */ + String NACOS_HOME = "nacos.home"; + + /** + * tomcat 目录 + */ + String TOMCAT_DIR = "server.tomcat.basedir"; +}