From f44d13ddec66af5cecb492b831df62bb1e940b47 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Mon, 2 Jul 2018 23:00:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81war=E5=8C=85=E4=B8=8D?= =?UTF-8?q?=E8=A7=A3=E5=8E=8B=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/jeesite/common/io/FileUtils.java | 8 +++++++ parent/pom.xml | 2 +- .../org.eclipse.wst.common.component | 10 ++++---- web/bin/run-web.bat | 24 +++++++++++++++---- web/bin/run-web.sh | 15 ++++++++---- web/pom.xml | 20 ++++++++++++++-- web/src/main/webapp/WEB-INF/startup.bat | 1 - web/src/main/webapp/WEB-INF/startup.sh | 2 +- 8 files changed, 63 insertions(+), 19 deletions(-) diff --git a/common/src/main/java/com/jeesite/common/io/FileUtils.java b/common/src/main/java/com/jeesite/common/io/FileUtils.java index bdf04805..46efaacf 100644 --- a/common/src/main/java/com/jeesite/common/io/FileUtils.java +++ b/common/src/main/java/com/jeesite/common/io/FileUtils.java @@ -948,6 +948,10 @@ public class FileUtils extends org.apache.commons.io.FileUtils { } catch (IOException e) { e.printStackTrace(); } + // 取不到,取当前工作路径 + if (StringUtils.isBlank(projectPath)){ + projectPath = System.getProperty("user.dir"); + } return projectPath; } @@ -982,6 +986,10 @@ public class FileUtils extends org.apache.commons.io.FileUtils { } catch (IOException e) { e.printStackTrace(); } + // 取不到,取当前工作路径 + if (StringUtils.isBlank(webappPath)){ + webappPath = System.getProperty("user.dir"); + } return webappPath; } diff --git a/parent/pom.xml b/parent/pom.xml index 7d0cb6f5..6859ac88 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -94,7 +94,7 @@ --> com.jeesite.modules.config.Application @@ -70,7 +71,7 @@ - ${project.artifactId} + ${finalName} ${project.basedir}/src/main/webapp/WEB-INF/classes/ @@ -84,6 +85,21 @@ maven-shade-plugin --> + + + org.apache.maven.plugins + maven-war-plugin + + + + ${project.build.directory}/${project.artifactId} + ${finalName} + + false + + + + org.apache.maven.plugins @@ -91,7 +107,7 @@ ${eclipse-plugin-download-sources} ${eclipse-plugin-download-javadocs} - ${project.artifactId} + ${finalName} 2.0 6.0 diff --git a/web/src/main/webapp/WEB-INF/startup.bat b/web/src/main/webapp/WEB-INF/startup.bat index ffa9157d..3810265e 100644 --- a/web/src/main/webapp/WEB-INF/startup.bat +++ b/web/src/main/webapp/WEB-INF/startup.bat @@ -15,7 +15,6 @@ rem echo. cd %~dp0 title %cd% - set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m if "%JAVA_HOME%" == "" goto noJavaHome diff --git a/web/src/main/webapp/WEB-INF/startup.sh b/web/src/main/webapp/WEB-INF/startup.sh index 58086622..f2d6ef3b 100644 --- a/web/src/main/webapp/WEB-INF/startup.sh +++ b/web/src/main/webapp/WEB-INF/startup.sh @@ -17,4 +17,4 @@ else RUN_JAVA="$JAVA_HOME"/bin/java fi -exec $RUN_JAVA -cp `dirname $0`/../ $JAVA_OPTS org.springframework.boot.loader.WarLauncher \ No newline at end of file +exec $RUN_JAVA -cp $PWD/../ $JAVA_OPTS org.springframework.boot.loader.WarLauncher \ No newline at end of file