
上QQ阅读APP看书,第一时间看更新
2.11 SpringBoot项目打包发布
SpringBoot作为微架构的主要实现技术,其发布项目的方式极为简单,只需要在项目中配置好插件,然后打包执行就可以了,并且这个执行不需要特别复杂的配置。
1.【mldnboot-base项目】修改pom.xml配置文件,配置SpringBoot的打包插件。

2.【mldnboot-base项目】由于Maven增加了新的插件配置,所以需要对项目进行更新,如图2-15所示。更新时选择mldnboot-base项目,如图2-16所示。

图2-15 Maven项目更新

图2-16 选择要更新的项目
3.【mldnboot-base项目】将当前项目模块进行打包处理(clean package),如图2-17所示。打包完成后,会在项目的target目录下生成mldnboot-base.jar程序文件。

图2-17 SpringBoot项目打包
4.【mldnboot-base项目】将mldnboot-base.jar文件复制到D盘根目录下,随后通过命令行方式执行此文件。

此时,SpringBoot项目将以一个独立的*.jar文件的方式执行。将此jar文件上传到任何配置有JDK的系统内,可以轻松实现项目的发布。