转自:https://blog.csdn.net/weixin_49736959/article/details/108969870
问题描述
在运行使用maven打包的项目之后,运行项目发现主类没有找到。提示XXX–1.0-SNAPSHOT.jar中没有主清单属性。

问题原因
maven在打包时没有配置主类。
解决方案
如果您使用的是Springboot框架,那么只需要在pom.xml中添加如下配置,会自动检测主类。
如果你是其他项目,你需要手动定位到主类。假设有如下主类。

再次运行成功:

参考文章:
https://blog.csdn.net/qq_40299028/article/details/90052774
https://blog.csdn.net/weixin_39448458/article/details/107508646