[运行报错] Maven打包SpringBoot项目,运行报错:no main manifest attribute, in xxx.jar-问题描述

时间:2024-02-17 07:44:54

IDEA创建SpringBoot 2.6.13项目(仅引入SpringMVC依赖),对生成的代码不做修改直接Maven打包。但运行报错:

# java -jar xxx.jar 
no main manifest attribute, in xxx.jar

检查jar包,

# jar -xvf xxx.jar 
# cat META-INF/MANIFEST.MF 
Manifest-Version: 1.0
Build-Jdk-Spec: 1.8
Created-By: Maven JAR Plugin 3.3.0