1、项目配置:
2、
3、
clean package --settings /usr/local/maven/conf/settings.xml -Dmaven.test.skip=true
4、
echo "transfer success" && sh /usr/local/sshdata/deploy/start-web.sh
顶层的一些配置:
1、
2、
全局工具配置:
1、
2、
3、
#!/bin/sh JAR_NAME=web-0.0.1-SNAPSHOT.jar JAR_PATH=/usr/local/sshdata/deploy JAR_WORK_PATH=/usr/local/sshdata/deploy/target JAR_BACK_PATH=/usr/local/sshdata/back date=`date +%Y%m%d%H%M%S` tpid=`ps -ef|grep $JAR_NAME|grep -v grep|grep -v kill|awk '{print $2}'` if [ ${tpid} ]; then echo 'Stop Process...' fi sleep 5 tpid=`ps -ef|grep $JAR_NAME|grep -v grep|grep -v kill|awk '{print $2}'` if [ ${tpid} ]; then echo 'Kill Process!' kill -9 $tpid else echo 'Stop Success!' fi tpid=`ps -ef|grep $JAR_NAME|grep -v grep|grep -v kill|awk '{print $2}'` if [ ${tpid} ]; then echo 'App is running.' else echo 'App is NOT running.' fi rm -f tpid echo "开始备份" chmod 755 $JAR_NAME mv $JAR_WORK_PATH/$JAR_NAME $JAR_BACK_PATH/${JAR_NAME%%.*}${date}.jar echo "备份成功" #复制jar包到执行目录 echo "开始复制jar包到执行目录:cp $JAR_PATH/$JAR_NAME $JAR_WORK_PATH" mv $JAR_PATH/$JAR_NAME $JAR_WORK_PATH echo "复制jar包完成" cd $JAR_WORK_PATH chmod 755 $JAR_NAME nohup java -jar ./$JAR_NAME echo "$JAR_NAME" echo $! > tpid echo 'Start Success!'
error:不能退出命令行,只能等超时退出,解决:
ERROR: Exception when publishing, exception message [Exec timed out or was interrupted after XXX ms
参考:https://blog.csdn.net/u013066244/article/details/52788407
没起到作用,只能把超时时间缩短