打的jar包报没有主属性清单时,也就是找不到启动类
有两种可能:
1.pom文件中没有引入spring-boot-starter-parent。此依赖的一个作用就是封装了打可执行jar、war的配置。
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.5.RELEASE</version>
<relativePath/>
</parent>
2.pom的spring-boot-maven-plugin插件找不到启动类或者是有多个main方法,可以试试手动配置。
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.health.shanghai.Application</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>