java---微服务中子模块相互引用,打包时候报错“找不到”,如何解决

在遇到user模块打包发布时找不到common模块的jar问题,可以在common模块的pom.xml中配置spring-boot-maven-plugin,设置<attach>false</attach>,然后先清理并安装common到本地仓库,再打包user模块即可解决依赖问题。
摘要由CSDN通过智能技术生成

现在有 common模块和user模块,还有父模块,现在情况是user使用common中的一些方法,但是呢,user在打包发布的时候报错,发现找不到common模块的jar,但是方法中也在引用不报错,这时候怎么解决呢,需要在common模块的pom中加“configuration”

  <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <attach>false</attach>
                </configuration>
            </plugin>
        </plugins>
    </build>

然后user在打包之前,需要将common模块 先clean,然后install打到本地仓库,再去打user就ok了。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值