SpringBoot+Maven聚合多项目打包成jar

已我最近自己在玩的一个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插件

转载于:https://www.cnblogs.com/it-taosir/p/9728772.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值