在pom.xml中添加对应的依赖
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.zyxx.DeclareApplication</mainClass>
<layout>ZIP</layout>
<includes>
<include>
<groupId>nothing</groupId>
<artifactId>nothing</artifactId>
</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<finalName>制定系统名称(自定义)</finalName>
</build>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
shell脚本的修改:
#!/usr/bin/env bash
#
# Startup script for jetty under *nix systems(it works under NT/cygwin too).
#!/bin/sh
rm -rf /var/sn/fps/tpid
export PATH=/usr/local/jdk/jdk1.8.0_131/bin:$PATH
nohup java -Xms4G -Xmx4G -XX:NewRatio=1 -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -Xloggc:./gc.log -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./logs/heapdump-fps.hprof -Dloader.path=./lib -jar ./FPS.jar server (添加配置文件 application.yml) > /dev/null 2>&1 &
echo $! >/var/sn/fps/tpid