Unable to find main class

文章讲述了在重构SpringBoot2.x项目时,遇到公共模块在执行mavencleaninstall时报错Unabletofindmainclass。解决方案是在公共模块的pom.xml中添加SpringBootMaven插件配置,跳过打包过程。参考链接提供了类似问题的解决方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、Unable to find main class

1.1、问题描述

        最近在写Spring Boot2.x的项目重构,之前写的demo里面有很多地方重复,正好现在有时间就把这些公共组件做一个抽取,抽取出了一个公共模块,但是在执行maven clean install指令时,报错Unable to find main class,如下所示:

1.2、解决

        公共模块的pom.xml文件中添加如下配置:

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

1.3、效果

1.4、参考

https://blog.youkuaiyun.com/weixin_43888891/article/details/130487516

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值