支持war包不解压的情况下运行。
This commit is contained in:
@@ -948,6 +948,10 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
// 取不到,取当前工作路径
|
||||||
|
if (StringUtils.isBlank(projectPath)){
|
||||||
|
projectPath = System.getProperty("user.dir");
|
||||||
|
}
|
||||||
return projectPath;
|
return projectPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -982,6 +986,10 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
// 取不到,取当前工作路径
|
||||||
|
if (StringUtils.isBlank(webappPath)){
|
||||||
|
webappPath = System.getProperty("user.dir");
|
||||||
|
}
|
||||||
return webappPath;
|
return webappPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
</goals> -->
|
</goals> -->
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- <classesDirectory>${project.outputDirectory}</classesDirectory>
|
<!-- <classesDirectory>${project.outputDirectory}</classesDirectory>
|
||||||
<finalName>jeesite</finalName>
|
<finalName>${finalName}</finalName>
|
||||||
<outputDirectory>${project.build.directory}/${project.artifactId}/WEB-INF/lib</outputDirectory>
|
<outputDirectory>${project.build.directory}/${project.artifactId}/WEB-INF/lib</outputDirectory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>com/thinkgem/jeesite/**</include>
|
<include>com/thinkgem/jeesite/**</include>
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||||
<wb-module deploy-name="jeesite-web">
|
<wb-module deploy-name="web">
|
||||||
<dependent-module archiveName="jeesite-module-core-4.0.4-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/jeesite-module-core/jeesite-module-core">
|
<dependent-module archiveName="jeesite-module-core-4.0.5-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/jeesite-module-core/jeesite-module-core">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
<dependent-module archiveName="jeesite-common-4.0.4-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/jeesite-common/jeesite-common">
|
<dependent-module archiveName="jeesite-common-4.0.5-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/jeesite-common/jeesite-common">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
<dependent-module archiveName="jeesite-framework-4.0.4-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/jeesite-framework/jeesite-framework">
|
<dependent-module archiveName="jeesite-framework-4.0.5-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/jeesite-framework/jeesite-framework">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
<property name="component.exclusion.patterns"/>
|
<property name="component.exclusion.patterns"/>
|
||||||
<property name="java-output-path" value="/src/main/webapp/WEB-INF/classes"/>
|
<property name="java-output-path" value="/src/main/webapp/WEB-INF/classes"/>
|
||||||
<property name="context-root" value="jeesite-web"/>
|
<property name="context-root" value="web"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/>
|
||||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||||
|
|||||||
@@ -13,11 +13,27 @@ cd %~dp0
|
|||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
call mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U
|
call mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U
|
||||||
|
|
||||||
cd target
|
cd target
|
||||||
call unzip -n *.war -d web
|
|
||||||
|
|
||||||
cd web/WEB-INF
|
title %cd%
|
||||||
call startup.bat
|
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
||||||
|
rem set JAVA_OPTS=%JAVA_OPTS% -Dspring.config.location=%cd%\app.yml
|
||||||
|
|
||||||
|
if "%JAVA_HOME%" == "" goto noJavaHome
|
||||||
|
if not "%JAVA_HOME%" == "" goto gotJavaHome
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:noJavaHome
|
||||||
|
set RUN_JAVA=java
|
||||||
|
goto runJava
|
||||||
|
|
||||||
|
:gotJavaHome
|
||||||
|
set RUN_JAVA="%JAVA_HOME%\bin\java"
|
||||||
|
goto runJava
|
||||||
|
|
||||||
|
:runJava
|
||||||
|
call "%RUN_JAVA%" %JAVA_OPTS% -jar web.war
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:end
|
||||||
pause
|
pause
|
||||||
@@ -11,10 +11,15 @@ echo ""
|
|||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U
|
mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U
|
||||||
|
|
||||||
cd target
|
cd target
|
||||||
unzip -n *.war -d web
|
|
||||||
|
|
||||||
cd web/WEB-INF
|
JAVA_OPTS="-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m"
|
||||||
chmod +x *.sh
|
#JAVA_OPTS="$JAVA_OPTS -Dspring.config.location=$PWD\app.yml"
|
||||||
./startup.sh
|
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
RUN_JAVA=java
|
||||||
|
else
|
||||||
|
RUN_JAVA="$JAVA_HOME"/bin/java
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec $RUN_JAVA $JAVA_OPTS -jar web.war
|
||||||
20
web/pom.xml
20
web/pom.xml
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
||||||
|
<finalName>web</finalName><!-- war包的名称 ${project.artifactId} -->
|
||||||
<start-class>com.jeesite.modules.config.Application</start-class>
|
<start-class>com.jeesite.modules.config.Application</start-class>
|
||||||
|
|
||||||
<!-- environment setting -->
|
<!-- environment setting -->
|
||||||
@@ -70,7 +71,7 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${finalName}</finalName>
|
||||||
<outputDirectory>${project.basedir}/src/main/webapp/WEB-INF/classes/</outputDirectory>
|
<outputDirectory>${project.basedir}/src/main/webapp/WEB-INF/classes/</outputDirectory>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
||||||
@@ -84,6 +85,21 @@
|
|||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
</plugin> -->
|
</plugin> -->
|
||||||
|
|
||||||
|
<!-- 打包插件, war包名称不带版本号 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<packagingExcludes></packagingExcludes>
|
||||||
|
<warSourceExcludes></warSourceExcludes>
|
||||||
|
<webappDirectory>${project.build.directory}/${project.artifactId}</webappDirectory>
|
||||||
|
<warName>${finalName}</warName>
|
||||||
|
<archive>
|
||||||
|
<addMavenDescriptor>false</addMavenDescriptor>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
<!-- Eclipse插件 -->
|
<!-- Eclipse插件 -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
@@ -91,7 +107,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<downloadSources>${eclipse-plugin-download-sources}</downloadSources>
|
<downloadSources>${eclipse-plugin-download-sources}</downloadSources>
|
||||||
<downloadJavadocs>${eclipse-plugin-download-javadocs}</downloadJavadocs>
|
<downloadJavadocs>${eclipse-plugin-download-javadocs}</downloadJavadocs>
|
||||||
<wtpContextName>${project.artifactId}</wtpContextName>
|
<wtpContextName>${finalName}</wtpContextName>
|
||||||
<wtpversion>2.0</wtpversion>
|
<wtpversion>2.0</wtpversion>
|
||||||
<jeeversion>6.0</jeeversion>
|
<jeeversion>6.0</jeeversion>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ rem echo.
|
|||||||
cd %~dp0
|
cd %~dp0
|
||||||
|
|
||||||
title %cd%
|
title %cd%
|
||||||
|
|
||||||
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
||||||
|
|
||||||
if "%JAVA_HOME%" == "" goto noJavaHome
|
if "%JAVA_HOME%" == "" goto noJavaHome
|
||||||
|
|||||||
@@ -17,4 +17,4 @@ else
|
|||||||
RUN_JAVA="$JAVA_HOME"/bin/java
|
RUN_JAVA="$JAVA_HOME"/bin/java
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec $RUN_JAVA -cp `dirname $0`/../ $JAVA_OPTS org.springframework.boot.loader.WarLauncher
|
exec $RUN_JAVA -cp $PWD/../ $JAVA_OPTS org.springframework.boot.loader.WarLauncher
|
||||||
Reference in New Issue
Block a user