From d957021bd2092a720115d17bfd604a94f1f5aa6d Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 6 May 2022 16:35:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8assembly=20=E5=88=86=E7=A6=BB?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E4=B8=8E=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- renren-admin/pom.xml | 112 ++++++++++++++---- .../src/main/resources/assembly/assembly.xml | 63 ++++++++++ .../resources/assembly/bin/renren-admin.sh | 40 +++++++ 3 files changed, 192 insertions(+), 23 deletions(-) create mode 100644 renren-admin/src/main/resources/assembly/assembly.xml create mode 100644 renren-admin/src/main/resources/assembly/bin/renren-admin.sh diff --git a/renren-admin/pom.xml b/renren-admin/pom.xml index 4828f39b..bebc497a 100644 --- a/renren-admin/pom.xml +++ b/renren-admin/pom.xml @@ -222,37 +222,103 @@ ${project.artifactId} + + + src/main/resources + + + + + + src/main/resources + true + + application.properties + application-${profile.env}.properties + + + + - org.springframework.boot - spring-boot-maven-plugin + org.apache.maven.plugins + maven-jar-plugin - true + target/classes/ + + + false + + + io.renren.AdminApplication + false + + true + + lib/ + + + . + + + org.apache.maven.plugins - maven-surefire-plugin - - true - - - - com.spotify - docker-maven-plugin - ${docker.plugin.version} - - renren/${project.artifactId} - ${project.basedir}/ - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - + maven-assembly-plugin + + + make-tar.gz + + package + + + single + + + + + + + + + src/main/resources/assembly/assembly.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/assembly/assembly.xml b/renren-admin/src/main/resources/assembly/assembly.xml new file mode 100644 index 00000000..34cb319e --- /dev/null +++ b/renren-admin/src/main/resources/assembly/assembly.xml @@ -0,0 +1,63 @@ + + + 1.0 + + + tar.gz + + + + + + + true + lib + + + + + + + + src/main/resources/assembly/bin + + + 0755 + unix + true + + + + ${project.basedir}/lib + lib/ + + + + + src/main/resources + + *.yml + *.properties + *.json + + true + ${file.separator}config + + + + + target + / + + *.jar + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/assembly/bin/renren-admin.sh b/renren-admin/src/main/resources/assembly/bin/renren-admin.sh new file mode 100644 index 00000000..2464f423 --- /dev/null +++ b/renren-admin/src/main/resources/assembly/bin/renren-admin.sh @@ -0,0 +1,40 @@ +#! /bin/bash +#chkconfig: 2345 85 15 +#description:auto_run +#processname:zf +#JAR根位置 +JAR_ROOT=`pwd` +#JAR位置 +JAR_PATH="$JAR_ROOT"/renren-admin.jar + +#LOG位置 +LOG_PATH=/dev/null + +#开始方法 +start() { + cd $JAR_ROOT + nohup java -Dfile.encoding=utf-8 -server -Xms256m -Xmx1g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./ -jar $JAR_PATH --server.port=8888 >$LOG_PATH 2>&1 & + echo "$JAR_PATH start success." +} + +#结束方法 +stop() { + kill -9 `ps -ef|grep $JAR_PATH|grep -v grep|grep -v stop|awk '{print $2}'` + echo "$JAR_PATH stop success." +} + +case "$1" in +start) + start + ;; +stop) + stop + ;; +restart) + stop + start + ;; +*) + echo "Userage: $0 {start|stop|restart}" + exit 1 +esac