SpringBoot+Maven聚合多项目打包成jar
2024-08-31 10:44:42
已我最近自己在玩的一个DEMO为例
taosir为pom.xml,其他子项目均为其modules,且为jar项目
eureka为注册中心、workflow为提供者、entrance为调用方
entrance、workflow依赖于common
所以此处我需要将eureka、workflow、entrance三个打包成jar,那么它们的pom.xml文件中需加入
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
其他的子项目,包括父项目taosir的pom.xml都不要build
OK↓
在taosir项目右键 -> run as -> maven build...
Run完即可在各项目的target文件夹下找到各自的jar包了!
cmd下 java -jar 文件路径,即可运行
可能出现的问题及其解决
一、No compiler is provided in this environment. Perhaps you are running
on a JRE rather than a JDK
然后加上自己对应的jdk即可
二、invalid LOC header (bad signature)
去本地仓库删掉对应的不正确的jar包,重新update下项目
三、Exception occurred during processing request: Unable to compile class
for JSP
不再使用Maven 默认的 tomcat-maven-plugin 插件,改用tomcat(6、7、8等版本)-maven-plugin插件
最新文章
- Django基础,Day9 - 静态文件目录与路径设置说明(eg. images, JavaScript, CSS)
- 记一次使用jQuery清空元素
- netsh端口转发
- No2. S2错题本
- 【Netty学习】 ChannelHandler 改动及影响
- 【转】Android 源码编译make的错误处理--不错
- NIO的学习
- The initialize list of C++ Class
- 在WPF中使用AForge.net控制摄像头拍照
- 上Mysql com.mysql.jdbc.StatementImpl$CancelTask内存泄漏问题和解决方法
- 2014辽宁ACM省赛 Prime Factors
- Linux多进程编程实例
- Cocos2D将v1.0的tileMap游戏转换到v3.4中一例(一)
- 【java错误】Non-terminating decimal expansion; no exact representable decimal result
- 「ZJOI2017」树状数组(二维线段树)
- shell:实现linux服务器资源监控并发送告警邮件
- Ionic 1 &; 2 开发常见问题 Q&;A
- python day02--运算符,编码
- rabbitmq 二进制安装
- Qt 学习之路 2(55):数据库操作
热门文章
- uni-app 路由navigate
- 题解 ZOJ3203 Light Bulb
- BA--空调静压箱的作用
- Mybatis分页插件2.0版本号公布
- Android Otto调研
- 从零单排入门机器学习:线性回归(linear regression)实践篇
- java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException
- HDU 1160 FatMouse&;#39;s Speed DP题解
- 0x22 迭代加深
- 原生js实现复选框