多模块打包报错找不到包的问题

编程入门 行业动态 更新时间:2024-10-17 19:26:39

多模块打包报错<a href=https://www.elefans.com/category/jswz/34/1771416.html style=找不到包的问题"/>

多模块打包报错找不到包的问题

最近做微服务项目,服务A,服务B,..,服务A依赖B,在idea里都可以跑起来,但是当打包部署到服务器时,懵逼了,各种clean package 就是不行,总是报找不到类或找不到包,痛定思通,网上各种百度,结果试了下这个可以。

在被依赖的B服务pom里添加:

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

其他模块:

<build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId>           <executions><execution><goals><goal>repackage</goal></goals></execution></executions></plugin></plugins>
</build>

然后clean package 就可以了:

注意:如果你的配置文件就是如上配置,那么你需要在maven打包的时候,install一下,就可以依赖了

更多推荐

多模块打包报错找不到包的问题

本文发布于:2023-12-08 13:07:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1672882.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   报错   多模

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!