解决使用idea打包或安装时 出现 Unable to find main class 错误和不能找到依赖模块的类

编程入门 行业动态 更新时间:2024-10-21 18:31:15

解决使用idea打包或安装时 出现 Unable to find main class 错误和不能找到依赖<a href=https://www.elefans.com/category/jswz/34/1771428.html style=模块的类"/>

解决使用idea打包或安装时 出现 Unable to find main class 错误和不能找到依赖模块的类

Unable to find main class

当我对工具模块进行package 或install的时候,报错: Unable to find main class 。
原因是:此module继承了父模块的pom中的最关键的一个配置:

<plugins><plugin><!--SpringBoot项目打包使用的插件--><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin>
</plugins>

这个配置是Springboot的打包插件,它打包时会去找SpringBoot启动类。
解决办法:我们项目模块的打包插件配置不要放到最顶层的pom.xml中。反正不要让公共工具模块继承到此配置, 只让我们的需要打包执行的微服务继承就行。

不能找到依赖模块的类

The POM for 0.0.1-SNAPSHOT is missing, no dependency informat
解决办法:工具模块及其他pom模块都要先install
解决办法:工具模块都要先install

更多推荐

解决使用idea打包或安装时 出现 Unable to find main class 错误和不能找到依赖模块的类

本文发布于:2024-03-08 15:43:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1721329.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模块   错误   Unable   idea   find

发布评论

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

>www.elefans.com

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