.jar中没有主清单属性

问题:xxx.jar中没有主清单属性
背景:maven项目,springboot服务
IDEA打包,jar包运行出现上述错误
解决方案:
pom.xml 中添加

org.springframework.boot
spring-boot-maven-plugin
/pre>
p>完美解决。
/p>
h3>看下原因:
/h3>
pre class='language-javascript'>
Manifest-Version: 1.0
Implementation-Title: websocket-client
Implementation-Version: 1.0.0.1
Built-By: Administrator
Implementation-Vendor-Id: com.xue.study
Created-By: Apache Maven 3.5.2
Build-Jdk: 1.8.0_144
Implementation-URL: https://projects.spring.io/spring-boot/#/spring-bo
ot-starter-parent/websocket-client/pre>
p>----
/p>
pre class='language-javascript'>
Manifest-Version: 1.0
Implementation-Title: websocket-client
Implementation-Version: 1.0.0.2
Built-By: Administrator
Implementation-Vendor-Id: com.xue.study
Spring-Boot-Version: 2.1.4.RELEASE
Main-Class: org.springframework.boot.loader.JarLauncher
Start-Class: com.xue.study.WebsocketClientDemo
Spring-Boot-Classes: BOOT-INF/classes/
Spring-Boot-Lib: BOOT-INF/lib/
Created-By: Apache Maven 3.5.2
Build-Jdk: 1.8.0_144
Implementation-URL: https://projects.spring.io/spring-boot/#/spring-bo
ot-starter-parent/websocket-client/pre>
p>----
/p>
p>缺少启动类,找不到入口啊
/p>
pre class='language-javascript'>
Spring-Boot-Version: 2.1.4.RELEASE
+ Main-Class: org.springframework.boot.loader.JarLauncher
+ Start-Class: com.xue.study.WebsocketClientDemo
Spring-Boot-Classes: BOOT-INF/classes/
Spring-Boot-Lib: BOOT-INF/lib//pre>
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/hz/139896.html