本篇文章給大家分享的是有關(guān)怎么在Spring Boot中使用Maven進(jìn)行打包,小編覺得挺實(shí)用的,因此分享給大家學(xué)習(xí),希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。
一、第一種Maven打包方式,將jar及resources下全部配置文件,拷貝到指定目錄:
E:/IDEAFile/file-copy/target/project org.springframework.boot spring-boot-maven-plugin org.apache.maven.plugins maven-jar-plugin 2.6 true lib/ com.example.filecopy.FileCopyApplication maven-resources-plugin copy-resources validate copy-resources ${project.build.directory}/project src/main/resources true maven-antrun-plugin package run
第二種Maven打包方式使用 assembly插件,將jar及配置文件進(jìn)行壓縮打包到指定目錄:
org.springframework.boot spring-boot-maven-plugin org.apache.maven.plugins maven-jar-plugin 2.6 true lib/ com.example.filecopy.FileCopyApplication org.apache.maven.plugins maven-assembly-plugin 2.4 project /assembly/assembly.xml ${project.build.directory} false package single
assembly文件:
leaves zip true ${basedir}/src/main/resources ** true ${file.separator} ${project.build.directory} ${file.separator} *.jar
以上就是怎么在Spring Boot中使用Maven進(jìn)行打包,小編相信有部分知識點(diǎn)可能是我們?nèi)粘9ぷ鲿姷交蛴玫降?。希望你能通過這篇文章學(xué)到更多知識。更多詳情敬請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。