pom文件修改:

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
<plugins>
<!-- <plugin> -->
<!-- <groupId>org.springframework.boot</groupId> -->
<!-- <artifactId>spring-boot-maven-plugin</artifactId> -->
<!-- <executions> -->
<!-- <execution> -->
<!-- <goals> -->
<!-- <goal>build-info</goal> -->
<!-- </goals> -->
<!-- </execution> -->
<!-- </executions> -->
<!-- </plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<!-- 添加index则不从mainfest中读取classpath,而是从Index.list中读取 -->
<!-- <index>true</index> -->
<manifest>
<mainClass>xxx.xxxxx.XXXApplication</mainClass>
<!-- to create a class path to your dependecies you have to fill true
in this field -->
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<!--<classpathLayoutType>custom</classpathLayoutType> <customClasspathLayout>
lib/$${artifact.groupId}.$${artifact.artifactId}.$${artifact.extension} </customClasspathLayout> -->
</manifest>
<manifestEntries>
<Class-Path>./</Class-Path>
</manifestEntries>
</archive>
<excludes>
<exclude>application*.yml</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<!-- not append assembly id in release file name -->
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/resources/package.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

package xml配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>package</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>bin</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<scope>runtime</scope>
<!-- <unpack>false</unpack> -->
<excludes>
<!-- <exclude>${project.name}-${project.version}</exclude> -->
<exclude>${groupId}:${artifactId}</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>

最新文章

  1. 使用jQuery的animate方法制作滑动菜单
  2. nodejs常用组件
  3. jquery左右链接类似frameset的插件
  4. 5.3 Static
  5. Template_17_metaprogram
  6. HTML5 总结-拖放-3
  7. 配置IIS提示打开目录浏览时的问题:未能从程序集“System.ServiceModel, Version=3.0.0.0”中加载类型“System.ServiceModel.Activation.HttpModule” 的解决办法
  8. javaweb学习总结——Filter高级开发
  9. BZOJ 2324: [ZJOI2011]营救皮卡丘(带上下限的最小费用最大流)
  10. 循环神经网络RNN公式推导走读
  11. HDU 1541 树状数组
  12. POJ - 3414 bfs [kuangbin带你飞]专题一
  13. linux学习之路--(三)文件系统
  14. WebGL three.js学习笔记 自定义顶点建立几何体
  15. Python爬虫入门教程 14-100 All IT eBooks多线程爬取
  16. SQL Server进阶(七)集合运算
  17. CSS公共清除浏览器默认样式
  18. C和C指针小记(十七)-使用结构和指针-链表
  19. win的使用
  20. 小波学习之二(单层一维离散小波变换DWT的Mallat算法C++实现优化)--转载

热门文章

  1. Flask常用路由参数
  2. 洛谷 P5057 [CQOI2006]简单题 题解
  3. Python中字符串匹配函数startswith()函数
  4. Python中的next()\iter()函数详解
  5. 基于web公交查询系统自我安排进度
  6. ssl证书转换cer转pem
  7. 【转】Web实现前后端分离,前后端解耦
  8. 用简单的JS代码制作计算器
  9. [转帖]vagrant 添加带版本号的 box
  10. 【拆分版】Docker-compose构建Kibana单实例,基于7.1.0