diff --git a/.classpath b/.classpath index eda7eb0..0d4ed46 100644 --- a/.classpath +++ b/.classpath @@ -1,11 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_121"> - <attributes> - <attribute name="owner.project.facets" value="java"/> - </attributes> - </classpathentry> <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.5"> <attributes> <attribute name="owner.project.facets" value="jst.web"/> @@ -16,5 +11,6 @@ <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> </attributes> </classpathentry> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="output" path="build/classes"/> </classpath> diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 3a2942c..c82bd8e 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -3,6 +3,6 @@ <wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/> <property name="java-output-path" value="/web/build/classes"/> - <property name="context-root" value="web"/> + <property name="context-root" value="/"/> </wb-module> </project-modules> diff --git a/config/log4j2.xml b/config/log4j2.xml index 983638a..d82a26b 100644 --- a/config/log4j2.xml +++ b/config/log4j2.xml @@ -3,7 +3,7 @@ <Properties> <!-- 云端部署 这里的logs为项目根目录下的logs文件夹 --> <!-- web:rootDir指向web应用根目录,需使用log4j-web.jar --> - <Property name="log_path">F:\workspace\workspace pers\web/logs</Property> + <Property name="log_path">G:\workspace\workspace pers\web/logs</Property> <!-- 本地开发使用绝对路径定义日志 --> <!-- <Property name="log_path">${web:rootDir}\logs</Property> --> diff --git a/src/pers/husen/web/config/ProjectDeployConfig.java b/src/pers/husen/web/config/ProjectDeployConfig.java index a6221cc..ef837a8 100644 --- a/src/pers/husen/web/config/ProjectDeployConfig.java +++ b/src/pers/husen/web/config/ProjectDeployConfig.java @@ -21,7 +21,7 @@ public class ProjectDeployConfig { /** 工程部署路径,如 本地为 web\WebContent\, 服务器为/web **/ public static File WEB_DEPLOY_PATH; - /** 工程根目录路径 如 /web **/ + /** 工程根目录路径 ,web的同级目录 **/ public static String WEB_ROOT_PATH; /** 日志配置文件路径 */ @@ -45,16 +45,6 @@ public class ProjectDeployConfig { * @param deployPath */ public static void setGlobalVariable(String deployPath) { - WEB_DEPLOY_PATH = new File(deployPath); - WEB_ROOT_PATH = WEB_DEPLOY_PATH.getParent(); - - LOG4J2_CONFIG_PATH = WEB_ROOT_PATH + CommonConstants.LOG4J2_CONFIG_FILE_RELATIVE_PATH; - DB_CONNECT_INFO_FILE_PATH = WEB_ROOT_PATH + CommonConstants.DB_CONNECT_INFO_FILE_RELATIVE_PATH; - - LOG4J2_OUT_PATH = WEB_ROOT_PATH + CommonConstants.LOG_OUT_FILE_RELATIVE_PATH; - DOWNLOAD_PATH = WEB_ROOT_PATH + CommonConstants.DOWNLOAD_FILE_RELATIVE_PATH; - IMAGE_PATH = WEB_ROOT_PATH + CommonConstants.IMAGE_UPLOAD_FILE_PATH; - /** * 根据os.name判断当前是本地开发还是远程部署 * 在centos为 Linux, @@ -71,5 +61,20 @@ public static void setGlobalVariable(String deployPath) { Logger logger = LogManager.getLogger(WebInitConfigListener.class); logger.fatal("识别 user.dir -> " + currOsName + " 出错,使用log4j2默认配置"); } + + if(IS_REMOTE_DEPLOY) { + WEB_DEPLOY_PATH = new File(deployPath); + }else { + WEB_DEPLOY_PATH = new File("G:/workspace/workspace pers/web/WebContent/"); + } + + WEB_ROOT_PATH = WEB_DEPLOY_PATH.getParent(); + + LOG4J2_CONFIG_PATH = WEB_ROOT_PATH + CommonConstants.LOG4J2_CONFIG_FILE_RELATIVE_PATH; + DB_CONNECT_INFO_FILE_PATH = WEB_ROOT_PATH + CommonConstants.DB_CONNECT_INFO_FILE_RELATIVE_PATH; + + LOG4J2_OUT_PATH = WEB_ROOT_PATH + CommonConstants.LOG_OUT_FILE_RELATIVE_PATH; + DOWNLOAD_PATH = WEB_ROOT_PATH + CommonConstants.DOWNLOAD_FILE_RELATIVE_PATH; + IMAGE_PATH = WEB_ROOT_PATH + CommonConstants.IMAGE_UPLOAD_FILE_PATH; } } \ No newline at end of file