最近一个springboot打包jar部署问题,费了好久才解决。本人springboot新手,遇到问题后再百度好多文章中没有找到直接的解决方案,巧合下解决问题,废话了不少,开始正题吧
一:前台模板选型 thymeleaf,所以要打jar包
二:再介绍下项目结构引用关系。
父-->yuan-base(共用模块)-->(yuan-blog,yuan-calendar,yuan-back)(引用base)-->yuan-run(web启动模块)
三:只有yuan-run的pom文件中有build,其他模块都是没有build节点的
<build> <finalName>protocol</finalName> <plugins> <!-- Srping Boot 打包工具 --> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> <!-- 指定JDK编译版本 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> </build>