我有一个项目命名为:airline,里面module有:airline-rest, airline-common, airline-mapper, airline-admin, airline-core等模块。
因为运维强制要求: 将每次mvn的特别大的集成jar包,改成增量包形式。
airline-rest, airline-admin就需要打成增量包的形式。
一.pom.xml配置
先看下airline-rest, airline-admin的pom.xml配置文件
csharp;gutter:true;
org.apache.maven.plugins
maven-jar-plugin</p>
<pre><code> *.**
*/*.xml
true
lib/
false
com.xxx.rest.Application
./resources/
${project.build.directory}
org.apache.maven.plugins
maven-dependency-plugin
copy-dependencies
package
copy-dependencies
${project.build.directory}/lib/
maven-resources-plugin
copy-resources
package
copy-resources
src/main/resources
${project.build.directory}/config
org.springframework.boot
spring-boot-maven-plugin
null
null
ZIP
true
${project.build.directory}
repackage
${project.artifactId}
src/main/java
**/*.*
src/main/resources
**/*.*
</code></pre>
<p>
二.mvn打包
cmd里面输入:mvn clean install test.skip=true
三.将生成的jar部署
进入到:targe文件夹,将: config、lib、airline-rest.jar拷贝出来,交给运维部署
如何打增量包呢?
一.创建一个git仓库,
将打好的airline-rest.jar、config、lib上传到git中,输入内容为:第一次
二.根据需求修改代码,打增量包
将修改好的代码进行: mvn打包。
将打好的, airline-rest.jar、config、lib上传到git中,输入内容为:第二次
三.打增量包
3.1.右击当前git项目:TortoiseGit->显示日志,如下
3.2复制第一次打包的SHA-1:
SHA-1: f3ada7f832949fec8b7ef5274e4574b9f656908b
3.3打增量包:
右击进入:Git Bash here命令行
输入打增量包命令
tar czvf airline-rest.tar.gz $(git diff f3ada7f832949fec8b7ef5274e4574b9f656908b –name-only)
记住:复制的SHA-1,一定是上一次commit提交的数据,
四.交给运维部署
Original: https://www.cnblogs.com/achengmu/p/15160859.html
Author: 穆晟铭
Title: pom打增量包,使用mvn命令对pom.xml打增量包
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/551156/
转载文章受原作者版权保护。转载请注明原作者出处!