Springboot 打包自带启动脚本】的更多相关文章

一直以来,我都是 gradlew build java -jar xxx.jar 来启动springboot项目的.今天突然发现,springboot自动封装了一个bootJar的任务脚本. demo: https://github.com/Ryan-Miao/Spring-Cloud-Greenwich-Demo/commit/ed47988218f59d2ca49ce5d328433985da067a14 添加 bootJar { launchScript() } 然后 gradlew xx…
#!/bin/bash #这里可替换为你自己的执行程序,其他代码无需更改 APP_NAME=csadmin.jar #使用说明,用来提示输入参数 usage(){ echo "Usage: sh 脚本名.sh [start|stop|restart|status]" exit 1 } #检查程序是否在运行 is_exist(){ pid=`ps -ef|grep $APP_NAME|grep -v grep|awk '{print $2}' ` #如果不存在返回1,存在返回0 if […
startup.bat @echo off set path=X:\xxxxxxx\Java\JDK\jre\bin START "项目名" "%path%\java" -jar 要启动的jar包路径 shutdown.bat         这是根据项目名停止项目运行 wmic process where (commandline LIKE "%%项目名%%" and caption="java.exe") call ter…
本篇和大家分享的是springboot打包并结合shell脚本命令部署,重点在分享一个shell程序启动工具,希望能便利工作: profiles指定不同环境的配置 maven-assembly-plugin打发布压缩包 分享shenniu_publish.sh程序启动工具 linux上使用shenniu_publish.sh启动程序 profiles指定不同环境的配置 通常一套程序分为了很多个部署环境:开发,测试,uat,线上 等,我们要想对这些环境区分配置文件,可以通过两种方式: 通过appl…
将springboot项目打包成jar后,上传至服务器,每次都需要手敲命令,重新部署项目,可将这些命令写入脚本中,直接运行. 启动脚本(start.sh): CUR_PATH=$(cd "$(dirname "$0")"; pwd) echo "Current path: ${CUR_PATH}" /usr/lib/java-1.8.0/jdk1.8.0_161/bin/java -jar ${CUR_PATH}/***.jar 代码中的标红部分…
转:https://segmentfault.com/a/1190000013489340 Spring Boot Takes an opinionated view of building production-ready Spring applications. Spring Boot favors convention over configuration and is designed to get you up and running as quickly as possible. S…
springboot打包时,去掉资源文件 <build> <resources> <resource> <directory>src/main/resources</directory> <excludes> <exclude>*.properties</exclude> <exclude>*.xml</exclude> </excludes> </resource&g…
本文介绍如何打包Qt程序,使其在没有安装Qt的系统可以运行. 默认前提:另外一个系统和本系统是同一个系统版本. 1,编写导出依赖包的脚本copylib.sh #!/bin/bash LibDir=$PWD"/lib" Target=$1 lib_array=($(ldd $Target | grep -o "/.*" | grep -o "/.*/[^[:space:]]*")) $(mkdir $LibDir) for Variable in…
前言 这两天把视力档案后台部署的方式改了一下,由原来打包成war包,部署到一个tomcat里面,转变成直接打包成jar包,然后使用 java -jar命令进行启动 下面讲讲遇到的问题 1)java -jar 运行时是前台启动,并非后台运行 这个解决的方法是,使用nohub命令 nohup 是 no hang up 的缩写,就是不挂断的意思 nohup命令:如果你正在运行一个进程,而且你觉得在退出帐户时该进程还不会结束,那么可以使用nohup命令.该命令可以在你退出帐户/关闭终端之后继续运行相应的…
一.最终打包的目录结构 二.项目结构 三.开始 1.最终打包的目录,可根据自己需要修改. <properties> <mzservice.path>${project.build.directory}/mzservice</mzservice.path> </properties> 2.配置清理插件,每次打包前,清理之前生成的打包目录. <plugin> <artifactId>maven-clean-plugin</artif…