.jar中没有主清单属性

.jar中没有主清单属性

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

解决方案:
pom.xml 中添加

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

完美解决。

看下原因:

在这里插入图片描述

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

在这里插入图片描述

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

缺少启动类,找不到入口啊

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/
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页