修改pom.xml文件

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<!--打包时排除掉资源文件-->
<excludes>
<exclude>**/**</exclude>
</excludes>
</resource>
</resources> <plugins>
<plugin>
<!--打包时去除第三方依赖-->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layout>ZIP</layout>
<includes>
<include>
<groupId>non-exists</groupId>
<artifactId>non-exists</artifactId>
</include>
</includes>
</configuration>
</plugin>
<!--拷贝第三方依赖文件到指定目录-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!--target/lib是依赖jar包的输出目录,根据自己喜好配置-->
<outputDirectory>target/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
<stripVersion>false</stripVersion>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
  • 在target中把lib目录和jar文件再加了项目中的resource目录一起发布,启动命令是: java -jar -Dloader.path=.,resources,lib (可执行的jar包名称).jar
  • win10 用cmd 不要用powershell

最新文章

  1. 《你不知道的JavaScript -- 上卷》笔记 --- 基于ES6新标准
  2. 你眼中的async/await是什么样的?
  3. Javac早期(编译期)
  4. PHP Mongodb 基本操作
  5. 开发流程习惯的养成—TFS简单使用
  6. UVa 12230 (期望) Crossing Rivers
  7. List&lt;HashMap&gt;和HashMap
  8. 如何使盘ISO图像文件
  9. CSS Day04 css核心基础
  10. 51nod 1231 记分牌
  11. 浏览器将URL变成一个屏幕上显示的网页的过程?
  12. Java线程和线程池
  13. iOS - User Agent 的应用和设置
  14. .NET手记-Autofac进阶(属性和方法注入 Property and Method Injection)
  15. HTML编辑器 -- KindEditor
  16. laravel的重定向
  17. POJ 2771
  18. javascript研究小组知识库
  19. Keepalived系列一:Keepalived.conf 详解
  20. svn+apache+ssl快速部署

热门文章

  1. [c++] 面试题之犄角旮旯 第壹章
  2. 网络编程之多线程——GIL全局解释器锁
  3. python9
  4. filebeat的@timestamp字段时区问题
  5. python的pywinrm模块远程连接windows执行dos命令
  6. Centos 7 配置tomcat服务器
  7. 报错:ORA-25150:不允许对区参数执行ALERING
  8. ubuntu13 eclipse菜单栏失效解决
  9. linux 指定tomcat的具体路径
  10. .NET斗鱼直播弹幕客户端(上)