window 10
redhat 6.4
其他版本没有尝试,应该也是可以的
4.0.0 com.elvish test0.0.1-SNAPSHOT jar test2 test project for Spring Boot org.springframework.boot spring-boot-starter-parent1.5.10.RELEASE UTF-8 UTF-8 1.8 org.springframework.boot spring-boot-starter-weborg.springframework.boot spring-boot-starter-thymeleaftest org.apache.maven.plugins maven-compiler-plugin1.8 1.8 org.apache.maven.plugins maven-dependency-plugincopy-dependencies package copy-dependencies target/lib false false runtime org.springframework.boot spring-boot-maven-pluginZIP cn.jstars datatocloudorg.apache.maven.plugins maven-resources-pluginUTF-8 org.apache.maven.plugins maven-surefire-plugintrue true src/main/resources static/** templates/** *.yml *.properties *.xml *.txt
解释说明
maven-dependency-plugin 打出项目依赖的第三方包,放在lib下面
spring-boot-maven-plugin springboot打包插件,只保留了项目运行的jar包
resources 排除了我们需要外置的文件
将target下lib包和test.jar(运行包)以及src/main/resources下你需要外置的文件部署至服务器同一目录下,如
lib
test.jar
*.yml
*.xml
*.properties
static
templates
java -jar -Dloader.path="lib/" test.jar
作者:小红牛
链接:https://www.jianshu.com/p/7bf053450d39



