增加微服务模块代码生成的启动脚本

This commit is contained in:
thinkgem
2022-06-24 09:52:07 +08:00
parent 8951a3f07f
commit 9ccde22b15
4 changed files with 108 additions and 1 deletions

View File

@@ -173,6 +173,8 @@
<template>module_cloud/web/src/main/resources/config/bootstrap.xml</template>
<template>module_cloud/web/src/main/resources/config/logback-spring.xml</template>
<template>module_cloud/web/src/main/resources/static/static.xml</template>
<template>module_cloud/web/src/main/webapp/WEB-INF/startup.bat.xml</template>
<template>module_cloud/web/src/main/webapp/WEB-INF/startup.sh.xml</template>
<template>module_cloud/web/pom.xml</template>
</category>
</moduleTplCategory>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>run-web</name>
<filePath>${module.moduleCode}/${module.moduleCode}/src/main/webapp/WEB-INF</filePath>
<fileName>startup.bat</fileName>
<content><![CDATA[chcp 65001
@echo off
rem /**
rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
rem * No deletion without permission, or be held responsible to law.
rem *
rem * Author: ThinkGem@163.com
rem */
echo.
echo [信息] 运行Web工程。
echo.
rem pause
rem echo.
%~d0
cd %~dp0
title %cd%
rem 设置JDK目录
rem set "JAVA_HOME=%cd%\jdk1.8.0_x64"
rem 设置类加载路径
set "CLASS_PATH=%cd%/../"
rem 优化JVM参数
set "JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx1024m -Dfile.encoding=utf-8"
rem 方式一、配置外部自定义的属性文件(建议)
rem set "JAVA_OPTS=%JAVA_OPTS% -Dspring.config.location=%cd%\app.yml"
rem 方式二、配置环境名称,加载不同的属性文件
rem set "JAVA_OPTS=%JAVA_OPTS% -Dspring.profiles.active=prod"
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%" -cp %CLASS_PATH% %JAVA_OPTS% org.springframework.boot.loader.WarLauncher
goto end
:end
pause
]]>
</content>
</template>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>run-web</name>
<filePath>${module.moduleCode}/${module.moduleCode}/src/main/webapp/WEB-INF</filePath>
<fileName>startup.sh</fileName>
<content><![CDATA[#!/bin/sh
# /**
# * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
# * No deletion without permission, or be held responsible to law.
# *
# * Author: ThinkGem@163.com
# */
echo ""
echo "[信息] 运行Web工程。"
echo ""
# 设置JDK目录
# JAVA_HOME="$PWD/jdk1.8.0_x64"
# 设置类加载路径
CLASS_PATH="$PWD/../"
# 优化JVM参数
JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx1024m -Dfile.encoding=utf-8"
# 方式一、配置外部自定义的属性文件(建议)
# JAVA_OPTS="$JAVA_OPTS -Dspring.config.location=$PWD/app.yml"
# 方式二、配置环境名称,加载不同的属性文件
# JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=prod"
if [ -z "$JAVA_HOME" ]; then
RUN_JAVA=java
else
RUN_JAVA="$JAVA_HOME"/bin/java
fi
exec $RUN_JAVA -cp $CLASS_PATH $JAVA_OPTS org.springframework.boot.loader.WarLauncher
]]>
</content>
</template>

View File

@@ -23,7 +23,7 @@ rem
set "CLASS_PATH=%cd%/../"
rem <20>Ż<EFBFBD>JVM<56><4D><EFBFBD><EFBFBD>
set "JAVA_OPTS=-Xms512m -Xmx1024m"
set "JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx1024m"
rem <20><>ʽһ<CABD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
rem set "JAVA_OPTS=%JAVA_OPTS% -Dspring.config.location=%cd%\app.yml"