博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Spring boot打jar包分离静态资源
阅读量:4171 次
发布时间:2019-05-26

本文共 2282 字,大约阅读时间需要 7 分钟。

Pom

maven-compiler-plugin
1.8
1.8
org.apache.maven.plugins
maven-dependency-plugin
copy-dependencies
package
copy-dependencies
target/lib
false
false
runtime
org.apache.maven.plugins
maven-jar-plugin
**/*.properties
**/*.xml
**/*.yml
admin/**
mapper/**
excel/**
excelXml/**
org.springframework.boot
spring-boot-maven-plugin
ZIP
non-exists
non-exists
repackage
classes
false
org.apache.maven.plugins
maven-antrun-plugin
package
run
target/distribution
target/distribution/tmp
${project.artifactId}-${project.version}

主要通过       

<configuration>

          <excludes>
            <exclude>**/*.properties</exclude>
            <exclude>**/*.xml</exclude>
            <exclude>**/*.yml</exclude>
            <exclude>admin/**</exclude>
            <exclude>mapper/**</exclude>
            <exclude>excel/**</exclude>
            <exclude>excelXml/**</exclude>
          </excludes>
</configuration>

分离静态资源,

 <copy todir="${dist}">

                  <fileset dir="target/classes">
                    <include name="**/*.properties" />
                    <include name="**/*.xml" />
                    <include name="**/*.yml" />
                    <include name="admin/**" />
                    <include name="mapper/**" />
                    <include name="excel/**" />
                    <include name="excelXml/**" />
                  </fileset>
    </copy>

复制静态资源

启动命令:java -jar -Dloader.path=.,3rd-lib xxx-0.0.1-SNAPSHOT-classes.jar

转载地址:http://wvbai.baihongyu.com/

你可能感兴趣的文章
Android WebView加载Html右边空白问题的解决方案
查看>>
Android 仿网易新闻v3.5:上下滑动的引导页
查看>>
Android 天气预报图文字幕垂直滚动效果
查看>>
Android硬件加速
查看>>
智慧平安社区系统开发解决方案,智慧小区大数据分析平台建设
查看>>
NQI国家质量技术基础系统开发,国家质量基础设施平台建设
查看>>
nc命令用法举例
查看>>
Linux vmstat命令详解
查看>>
linux watch命令
查看>>
Linux lsof命令详解
查看>>
Ubuntu安装Anaconda
查看>>
蓝桥杯特别数的和(编程大题)
查看>>
Linux系统卡死,只有鼠标能动,解决办法
查看>>
三通道图像和四通道图像
查看>>
win10系统调出计算机和网络图标
查看>>
C/C++中字符串操作函数strcpy,strcat,strlen等
查看>>
贝壳找房机试题(笔试题)
查看>>
Xerces的下载,编译和在VS 2019中的配置
查看>>
国内快速访问GitHub的方法,亲测有用
查看>>
键盘fn键常亮(一直亮),解决办法
查看>>